banner_AML.jpg

  • Integrante 1: Santiago Martínez Novoa - 202112020

Contexto y objetivos.¶

En la actualidad, la cantidad de artículos publicados en Internet está generando una gran ola de información accesible por cualquier usuario, dando a conocer diferentes puntos de vista, opiniones, información e investigaciones sobre diferentes temas de interés.

Esta gran cantidad de información no solo permite una búsqueda exhaustiva sobre un tema, también permite realizar un análisis sobre la tendencia de los diferentes temas que estén dando de qué hablar en una sociedad. Es por ello que un grupo de expertos se ha dado la tarea de analizar 10.000 artículos web y clasificarlos para poder establecer un análisis de los temas en la actualidad.

Para ello, como experto en análisis con machine learning, le han pedido que construya un modelo capaz de clasificar los nuevos artículos, realice un análisis de cuáles son los temas que dan de que hablar y automatice el proceso de selección y búsqueda de diferentes artículos.

Objetivos de desarrollo:

  • Realizar el análisis y limpieza de textos.
  • Explorar las diferentes técnicas de transformación de datos no estructurados.
  • Establecer el mejor modelo basado en una red neuronal.

Datos: La fuente de los datos la puedes encontrar en News Articles Classification Dataset for NLP & ML.

Entendimiento del negocio.¶

Para tener un mejor detalle sobre el comportamiento de las variables, solicitamos a la organización el diccionario de datos y nos suministró la siguiente información:

ATRIBUTO DEFINICIÓN
headlines Titular del artículo.
description Reseña del artículo.
content Contenido del artículo.
url Dirección web del artículo.
category Representa la temática del artículo.

Actividades a realizar.¶

  1. Realizar el análisis exploratorio de componentes principales en la información.

  2. Identificar el número de componentes principales apropiado el procesamiento. Genera una tabla comparativa y los gráficos que apoyen este proceso. Recuerda que no deben truncarse los textos. Por último, la elección del número de componentes debe estar debidamente justificada.

  3. Construir la red neuronal tomando como insumo los componentes principales procesados en el punto anterior.

  4. Construir las gráficas de entrenamiento, validación. Debes interpretar los resultados obtenidos para este modelo base.

  5. Realizar la identificación de hiperparámetros, justificando la elección de los valores correspondientes.

NOTA: La calificación será sobre notebook ejecutado y cargado en Bloque Neón junto con el archivo HTML.

Estado GPU¶

In [1]:
gpu_info = !nvidia-smi
gpu_info = '\n'.join(gpu_info)
if gpu_info.find('failed') >= 0:
  print('Not connected to a GPU')
else:
  print(gpu_info)
Sun Apr 21 14:42:31 2024       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 536.67                 Driver Version: 536.67       CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                     TCC/WDDM  | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce GTX 1650      WDDM  | 00000000:2B:00.0  On |                  N/A |
| 23%   34C    P8              10W /  75W |   1338MiB /  4096MiB |     10%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A       500    C+G   ...on\123.0.2420.97\msedgewebview2.exe    N/A      |
|    0   N/A  N/A      4704    C+G   ...2txyewy\StartMenuExperienceHost.exe    N/A      |
|    0   N/A  N/A      8348    C+G   ...al\Discord\app-1.0.9042\Discord.exe    N/A      |
|    0   N/A  N/A      8456    C+G   C:\Windows\explorer.exe                   N/A      |
|    0   N/A  N/A     10048    C+G   ...les\Microsoft OneDrive\OneDrive.exe    N/A      |
|    0   N/A  N/A     13564    C+G   ...CBS_cw5n1h2txyewy\TextInputHost.exe    N/A      |
|    0   N/A  N/A     14620    C+G   ...ekyb3d8bbwe\PhoneExperienceHost.exe    N/A      |
|    0   N/A  N/A     16148    C+G   ...crosoft\Edge\Application\msedge.exe    N/A      |
|    0   N/A  N/A     16692    C+G   ...63.0_x64__zpdnekdrzrea0\Spotify.exe    N/A      |
|    0   N/A  N/A     18712    C+G   ...Data\Local\Programs\Opera\opera.exe    N/A      |
|    0   N/A  N/A     18912    C+G   ...Programs\Microsoft VS Code\Code.exe    N/A      |
|    0   N/A  N/A     21564    C+G   ...ta\Local\Programs\Notion\Notion.exe    N/A      |
|    0   N/A  N/A     21572    C+G   ...500_x64__8wekyb3d8bbwe\ms-teams.exe    N/A      |
|    0   N/A  N/A     25592    C+G   ...\Local\slack\app-4.37.101\slack.exe    N/A      |
|    0   N/A  N/A     25940    C+G   ...siveControlPanel\SystemSettings.exe    N/A      |
|    0   N/A  N/A     26260    C+G   ....0_x64__kzh8wxbdkxb8p\DCv2\DCv2.exe    N/A      |
|    0   N/A  N/A     28604    C+G   ...on\123.0.2420.97\msedgewebview2.exe    N/A      |
|    0   N/A  N/A     30264    C+G   ...8.0_x64__cv1g1gvanyjgm\WhatsApp.exe    N/A      |
|    0   N/A  N/A     31280    C+G   ...les\Microsoft OneDrive\OneDrive.exe    N/A      |
|    0   N/A  N/A     32236    C+G   ...1.0_x64__8wekyb3d8bbwe\Video.UI.exe    N/A      |
|    0   N/A  N/A     33744    C+G   ...5n1h2txyewy\ShellExperienceHost.exe    N/A      |
|    0   N/A  N/A     36592    C+G   ...on\123.0.2420.97\msedgewebview2.exe    N/A      |
|    0   N/A  N/A     37440    C+G   ...\cef\cef.win7x64\steamwebhelper.exe    N/A      |
|    0   N/A  N/A     41220    C+G   ...oogle\Chrome\Application\chrome.exe    N/A      |
|    0   N/A  N/A     41520    C+G   ...nt.CBS_cw5n1h2txyewy\SearchHost.exe    N/A      |
+---------------------------------------------------------------------------------------+

0. Importación de librerías¶

In [2]:
!pip install ydata-profiling
Collecting ydata-profiling
  Downloading ydata_profiling-4.7.0-py2.py3-none-any.whl (357 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 357.9/357.9 kB 5.8 MB/s eta 0:00:00
Requirement already satisfied: scipy<1.12,>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (1.11.4)
Requirement already satisfied: pandas!=1.4.0,<3,>1.1 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (2.0.3)
Requirement already satisfied: matplotlib<3.9,>=3.2 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (3.7.1)
Requirement already satisfied: pydantic>=2 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (2.6.4)
Requirement already satisfied: PyYAML<6.1,>=5.0.0 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (6.0.1)
Requirement already satisfied: jinja2<3.2,>=2.11.1 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (3.1.3)
Collecting visions[type_image_path]<0.7.7,>=0.7.5 (from ydata-profiling)
  Downloading visions-0.7.6-py3-none-any.whl (104 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.8/104.8 kB 5.7 MB/s eta 0:00:00
Requirement already satisfied: numpy<2,>=1.16.0 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (1.25.2)
Collecting htmlmin==0.1.12 (from ydata-profiling)
  Downloading htmlmin-0.1.12.tar.gz (19 kB)
  Preparing metadata (setup.py) ... done
Collecting phik<0.13,>=0.11.1 (from ydata-profiling)
  Downloading phik-0.12.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (686 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 686.1/686.1 kB 11.0 MB/s eta 0:00:00
Requirement already satisfied: requests<3,>=2.24.0 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (2.31.0)
Requirement already satisfied: tqdm<5,>=4.48.2 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (4.66.2)
Collecting seaborn<0.13,>=0.10.1 (from ydata-profiling)
  Downloading seaborn-0.12.2-py3-none-any.whl (293 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 293.3/293.3 kB 11.1 MB/s eta 0:00:00
Collecting multimethod<2,>=1.4 (from ydata-profiling)
  Downloading multimethod-1.11.2-py3-none-any.whl (10 kB)
Requirement already satisfied: statsmodels<1,>=0.13.2 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (0.14.1)
Collecting typeguard<5,>=4.1.2 (from ydata-profiling)
  Downloading typeguard-4.2.1-py3-none-any.whl (34 kB)
Collecting imagehash==4.3.1 (from ydata-profiling)
  Downloading ImageHash-4.3.1-py2.py3-none-any.whl (296 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 296.5/296.5 kB 12.0 MB/s eta 0:00:00
Requirement already satisfied: wordcloud>=1.9.1 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (1.9.3)
Collecting dacite>=1.8 (from ydata-profiling)
  Downloading dacite-1.8.1-py3-none-any.whl (14 kB)
Requirement already satisfied: numba<1,>=0.56.0 in /usr/local/lib/python3.10/dist-packages (from ydata-profiling) (0.58.1)
Requirement already satisfied: PyWavelets in /usr/local/lib/python3.10/dist-packages (from imagehash==4.3.1->ydata-profiling) (1.6.0)
Requirement already satisfied: pillow in /usr/local/lib/python3.10/dist-packages (from imagehash==4.3.1->ydata-profiling) (9.4.0)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2<3.2,>=2.11.1->ydata-profiling) (2.1.5)
Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib<3.9,>=3.2->ydata-profiling) (1.2.1)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib<3.9,>=3.2->ydata-profiling) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib<3.9,>=3.2->ydata-profiling) (4.51.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib<3.9,>=3.2->ydata-profiling) (1.4.5)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib<3.9,>=3.2->ydata-profiling) (24.0)
Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib<3.9,>=3.2->ydata-profiling) (3.1.2)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib<3.9,>=3.2->ydata-profiling) (2.8.2)
Requirement already satisfied: llvmlite<0.42,>=0.41.0dev0 in /usr/local/lib/python3.10/dist-packages (from numba<1,>=0.56.0->ydata-profiling) (0.41.1)
Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas!=1.4.0,<3,>1.1->ydata-profiling) (2023.4)
Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas!=1.4.0,<3,>1.1->ydata-profiling) (2024.1)
Requirement already satisfied: joblib>=0.14.1 in /usr/local/lib/python3.10/dist-packages (from phik<0.13,>=0.11.1->ydata-profiling) (1.4.0)
Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2->ydata-profiling) (0.6.0)
Requirement already satisfied: pydantic-core==2.16.3 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2->ydata-profiling) (2.16.3)
Requirement already satisfied: typing-extensions>=4.6.1 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2->ydata-profiling) (4.11.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.24.0->ydata-profiling) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.24.0->ydata-profiling) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.24.0->ydata-profiling) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.24.0->ydata-profiling) (2024.2.2)
Requirement already satisfied: patsy>=0.5.4 in /usr/local/lib/python3.10/dist-packages (from statsmodels<1,>=0.13.2->ydata-profiling) (0.5.6)
Requirement already satisfied: attrs>=19.3.0 in /usr/local/lib/python3.10/dist-packages (from visions[type_image_path]<0.7.7,>=0.7.5->ydata-profiling) (23.2.0)
Requirement already satisfied: networkx>=2.4 in /usr/local/lib/python3.10/dist-packages (from visions[type_image_path]<0.7.7,>=0.7.5->ydata-profiling) (3.3)
Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from patsy>=0.5.4->statsmodels<1,>=0.13.2->ydata-profiling) (1.16.0)
Building wheels for collected packages: htmlmin
  Building wheel for htmlmin (setup.py) ... done
  Created wheel for htmlmin: filename=htmlmin-0.1.12-py3-none-any.whl size=27080 sha256=a096c7cf2f2e69731073480fc7f3ad908fda0e13f73c12a150bb3460ed41be70
  Stored in directory: /root/.cache/pip/wheels/dd/91/29/a79cecb328d01739e64017b6fb9a1ab9d8cb1853098ec5966d
Successfully built htmlmin
Installing collected packages: htmlmin, typeguard, multimethod, dacite, imagehash, visions, seaborn, phik, ydata-profiling
  Attempting uninstall: seaborn
    Found existing installation: seaborn 0.13.1
    Uninstalling seaborn-0.13.1:
      Successfully uninstalled seaborn-0.13.1
Successfully installed dacite-1.8.1 htmlmin-0.1.12 imagehash-4.3.1 multimethod-1.11.2 phik-0.12.4 seaborn-0.12.2 typeguard-4.2.1 visions-0.7.6 ydata-profiling-4.7.0
In [3]:
!pip install kaggle
Requirement already satisfied: kaggle in /usr/local/lib/python3.10/dist-packages (1.5.16)
Requirement already satisfied: six>=1.10 in /usr/local/lib/python3.10/dist-packages (from kaggle) (1.16.0)
Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from kaggle) (2024.2.2)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.10/dist-packages (from kaggle) (2.8.2)
Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from kaggle) (2.31.0)
Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from kaggle) (4.66.2)
Requirement already satisfied: python-slugify in /usr/local/lib/python3.10/dist-packages (from kaggle) (8.0.4)
Requirement already satisfied: urllib3 in /usr/local/lib/python3.10/dist-packages (from kaggle) (2.0.7)
Requirement already satisfied: bleach in /usr/local/lib/python3.10/dist-packages (from kaggle) (6.1.0)
Requirement already satisfied: webencodings in /usr/local/lib/python3.10/dist-packages (from bleach->kaggle) (0.5.1)
Requirement already satisfied: text-unidecode>=1.3 in /usr/local/lib/python3.10/dist-packages (from python-slugify->kaggle) (1.3)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->kaggle) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->kaggle) (3.6)
In [4]:
!pip install keras-tuner
Collecting keras-tuner
  Downloading keras_tuner-1.4.7-py3-none-any.whl (129 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 129.1/129.1 kB 3.1 MB/s eta 0:00:00
Requirement already satisfied: keras in /usr/local/lib/python3.10/dist-packages (from keras-tuner) (2.15.0)
Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from keras-tuner) (24.0)
Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from keras-tuner) (2.31.0)
Collecting kt-legacy (from keras-tuner)
  Downloading kt_legacy-1.0.5-py3-none-any.whl (9.6 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->keras-tuner) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->keras-tuner) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->keras-tuner) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->keras-tuner) (2024.2.2)
Installing collected packages: kt-legacy, keras-tuner
Successfully installed keras-tuner-1.4.7 kt-legacy-1.0.5
In [5]:
!pip install spacy
Requirement already satisfied: spacy in /usr/local/lib/python3.10/dist-packages (3.7.4)
Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.11 in /usr/local/lib/python3.10/dist-packages (from spacy) (3.0.12)
Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from spacy) (1.0.5)
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.10/dist-packages (from spacy) (1.0.10)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy) (2.0.8)
Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy) (3.0.9)
Requirement already satisfied: thinc<8.3.0,>=8.2.2 in /usr/local/lib/python3.10/dist-packages (from spacy) (8.2.3)
Requirement already satisfied: wasabi<1.2.0,>=0.9.1 in /usr/local/lib/python3.10/dist-packages (from spacy) (1.1.2)
Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/lib/python3.10/dist-packages (from spacy) (2.4.8)
Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.10/dist-packages (from spacy) (2.0.10)
Requirement already satisfied: weasel<0.4.0,>=0.1.0 in /usr/local/lib/python3.10/dist-packages (from spacy) (0.3.4)
Requirement already satisfied: typer<0.10.0,>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from spacy) (0.9.4)
Requirement already satisfied: smart-open<7.0.0,>=5.2.1 in /usr/local/lib/python3.10/dist-packages (from spacy) (6.4.0)
Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.10/dist-packages (from spacy) (4.66.2)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from spacy) (2.31.0)
Requirement already satisfied: pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4 in /usr/local/lib/python3.10/dist-packages (from spacy) (2.6.4)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from spacy) (3.1.3)
Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from spacy) (67.7.2)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from spacy) (24.0)
Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/lib/python3.10/dist-packages (from spacy) (3.3.0)
Requirement already satisfied: numpy>=1.19.0 in /usr/local/lib/python3.10/dist-packages (from spacy) (1.25.2)
Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4->spacy) (0.6.0)
Requirement already satisfied: pydantic-core==2.16.3 in /usr/local/lib/python3.10/dist-packages (from pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4->spacy) (2.16.3)
Requirement already satisfied: typing-extensions>=4.6.1 in /usr/local/lib/python3.10/dist-packages (from pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4->spacy) (4.11.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (2024.2.2)
Requirement already satisfied: blis<0.8.0,>=0.7.8 in /usr/local/lib/python3.10/dist-packages (from thinc<8.3.0,>=8.2.2->spacy) (0.7.11)
Requirement already satisfied: confection<1.0.0,>=0.0.1 in /usr/local/lib/python3.10/dist-packages (from thinc<8.3.0,>=8.2.2->spacy) (0.1.4)
Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.10/dist-packages (from typer<0.10.0,>=0.3.0->spacy) (8.1.7)
Requirement already satisfied: cloudpathlib<0.17.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from weasel<0.4.0,>=0.1.0->spacy) (0.16.0)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->spacy) (2.1.5)
In [6]:
#Librerías para identificación de idiomas
!pip install polyglot
!pip install PyICU
!pip install pycld2
Collecting polyglot
  Downloading polyglot-16.7.4.tar.gz (126 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 126.3/126.3 kB 3.8 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: polyglot
  Building wheel for polyglot (setup.py) ... done
  Created wheel for polyglot: filename=polyglot-16.7.4-py2.py3-none-any.whl size=52561 sha256=145bf05131cc89b5d42b633a1b3feec07601fc9f79ebf1a7a5c1a4b9e045a8c5
  Stored in directory: /root/.cache/pip/wheels/aa/92/4a/b172589446ba537db3bdb9a1f2204f27fe71217981c14ac368
Successfully built polyglot
Installing collected packages: polyglot
Successfully installed polyglot-16.7.4
Collecting PyICU
  Downloading PyICU-2.12.tar.gz (260 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 260.0/260.0 kB 3.6 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: PyICU
  Building wheel for PyICU (pyproject.toml) ... done
  Created wheel for PyICU: filename=PyICU-2.12-cp310-cp310-linux_x86_64.whl size=1754545 sha256=ebe5f86aad3f8cfb6f3ef19bc0b43a60302a246099b645063d21237407487280
  Stored in directory: /root/.cache/pip/wheels/74/60/95/66d97ac2fdc8be8e526c4254047405fe77feaf064282d1ad07
Successfully built PyICU
Installing collected packages: PyICU
Successfully installed PyICU-2.12
Collecting pycld2
  Downloading pycld2-0.41.tar.gz (41.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.4/41.4 MB 20.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pycld2
  Building wheel for pycld2 (setup.py) ... done
  Created wheel for pycld2: filename=pycld2-0.41-cp310-cp310-linux_x86_64.whl size=9904064 sha256=ee3c7ff65f5da4b6bc71081c2082dad950d75679f93e805c37d29f73d6121462
  Stored in directory: /root/.cache/pip/wheels/be/81/31/240c89c845e008a93d98542325270007de595bfd356eb0b06c
Successfully built pycld2
Installing collected packages: pycld2
Successfully installed pycld2-0.41
In [7]:
!pip install contractions
Collecting contractions
  Downloading contractions-0.1.73-py2.py3-none-any.whl (8.7 kB)
Collecting textsearch>=0.0.21 (from contractions)
  Downloading textsearch-0.0.24-py2.py3-none-any.whl (7.6 kB)
Collecting anyascii (from textsearch>=0.0.21->contractions)
  Downloading anyascii-0.3.2-py3-none-any.whl (289 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 289.9/289.9 kB 5.6 MB/s eta 0:00:00
Collecting pyahocorasick (from textsearch>=0.0.21->contractions)
  Downloading pyahocorasick-2.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (110 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 110.7/110.7 kB 8.5 MB/s eta 0:00:00
Installing collected packages: pyahocorasick, anyascii, textsearch, contractions
Successfully installed anyascii-0.3.2 contractions-0.1.73 pyahocorasick-2.1.0 textsearch-0.0.24

1. Importación librerías¶

In [2]:
#Manejo de datos
import pandas as pd
import numpy as np

#Visualización de datos
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline

#Analisis profundo de datos
from ydata_profiling import ProfileReport

#Entrenamiento del modelo
import sklearn
from sklearn.decomposition import PCA, TruncatedSVD
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.model_selection import train_test_split
#from sklearn.metrics import mean_squared_error, r2_score
#from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import LabelEncoder
#from sklearn.compose import ColumnTransformer, make_column_selector
from sklearn.metrics import classification_report, confusion_matrix, PrecisionRecallDisplay

#Textos
import contractions
import nltk
import inflect
import re, string, unicodedata
from nltk import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import SnowballStemmer, WordNetLemmatizer
from wordcloud import WordCloud, STOPWORDS

#Tensorflow y keras
import tensorflow as tf
from keras.callbacks import EarlyStopping
from keras.models import Sequential
from keras.layers import Dense
from keras.utils import plot_model

#Sistema operativo
import os
import os.path as osp

#Librerías extras
import itertools
from datetime import datetime

print(f"La versión de sklearn es: {sklearn.__version__}")
print(f'La versión de Tensor Flow es:', tf.__version__)
La versión de sklearn es: 1.4.2
La versión de Tensor Flow es: 2.16.1

Descarga de información de nltk

In [3]:
nltk.download('all')
[nltk_data] Downloading collection 'all'
[nltk_data]    | 
[nltk_data]    | Downloading package abc to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package abc is already up-to-date!
[nltk_data]    | Downloading package alpino to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package alpino is already up-to-date!
[nltk_data]    | Downloading package averaged_perceptron_tagger to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package averaged_perceptron_tagger is already up-
[nltk_data]    |       to-date!
[nltk_data]    | Downloading package averaged_perceptron_tagger_ru to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package averaged_perceptron_tagger_ru is already
[nltk_data]    |       up-to-date!
[nltk_data]    | Downloading package basque_grammars to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package basque_grammars is already up-to-date!
[nltk_data]    | Downloading package bcp47 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package bcp47 is already up-to-date!
[nltk_data]    | Downloading package biocreative_ppi to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package biocreative_ppi is already up-to-date!
[nltk_data]    | Downloading package bllip_wsj_no_aux to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package bllip_wsj_no_aux is already up-to-date!
[nltk_data]    | Downloading package book_grammars to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package book_grammars is already up-to-date!
[nltk_data]    | Downloading package brown to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package brown is already up-to-date!
[nltk_data]    | Downloading package brown_tei to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package brown_tei is already up-to-date!
[nltk_data]    | Downloading package cess_cat to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package cess_cat is already up-to-date!
[nltk_data]    | Downloading package cess_esp to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package cess_esp is already up-to-date!
[nltk_data]    | Downloading package chat80 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package chat80 is already up-to-date!
[nltk_data]    | Downloading package city_database to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package city_database is already up-to-date!
[nltk_data]    | Downloading package cmudict to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package cmudict is already up-to-date!
[nltk_data]    | Downloading package comparative_sentences to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package comparative_sentences is already up-to-
[nltk_data]    |       date!
[nltk_data]    | Downloading package comtrans to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package comtrans is already up-to-date!
[nltk_data]    | Downloading package conll2000 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package conll2000 is already up-to-date!
[nltk_data]    | Downloading package conll2002 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package conll2002 is already up-to-date!
[nltk_data]    | Downloading package conll2007 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package conll2007 is already up-to-date!
[nltk_data]    | Downloading package crubadan to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package crubadan is already up-to-date!
[nltk_data]    | Downloading package dependency_treebank to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package dependency_treebank is already up-to-date!
[nltk_data]    | Downloading package dolch to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package dolch is already up-to-date!
[nltk_data]    | Downloading package europarl_raw to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package europarl_raw is already up-to-date!
[nltk_data]    | Downloading package extended_omw to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package extended_omw is already up-to-date!
[nltk_data]    | Downloading package floresta to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package floresta is already up-to-date!
[nltk_data]    | Downloading package framenet_v15 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package framenet_v15 is already up-to-date!
[nltk_data]    | Downloading package framenet_v17 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package framenet_v17 is already up-to-date!
[nltk_data]    | Downloading package gazetteers to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package gazetteers is already up-to-date!
[nltk_data]    | Downloading package genesis to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package genesis is already up-to-date!
[nltk_data]    | Downloading package gutenberg to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package gutenberg is already up-to-date!
[nltk_data]    | Downloading package ieer to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package ieer is already up-to-date!
[nltk_data]    | Downloading package inaugural to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package inaugural is already up-to-date!
[nltk_data]    | Downloading package indian to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package indian is already up-to-date!
[nltk_data]    | Downloading package jeita to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package jeita is already up-to-date!
[nltk_data]    | Downloading package kimmo to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package kimmo is already up-to-date!
[nltk_data]    | Downloading package knbc to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package knbc is already up-to-date!
[nltk_data]    | Downloading package large_grammars to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package large_grammars is already up-to-date!
[nltk_data]    | Downloading package lin_thesaurus to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package lin_thesaurus is already up-to-date!
[nltk_data]    | Downloading package mac_morpho to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package mac_morpho is already up-to-date!
[nltk_data]    | Downloading package machado to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package machado is already up-to-date!
[nltk_data]    | Downloading package masc_tagged to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package masc_tagged is already up-to-date!
[nltk_data]    | Downloading package maxent_ne_chunker to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package maxent_ne_chunker is already up-to-date!
[nltk_data]    | Downloading package maxent_treebank_pos_tagger to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package maxent_treebank_pos_tagger is already up-
[nltk_data]    |       to-date!
[nltk_data]    | Downloading package moses_sample to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package moses_sample is already up-to-date!
[nltk_data]    | Downloading package movie_reviews to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package movie_reviews is already up-to-date!
[nltk_data]    | Downloading package mte_teip5 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package mte_teip5 is already up-to-date!
[nltk_data]    | Downloading package mwa_ppdb to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package mwa_ppdb is already up-to-date!
[nltk_data]    | Downloading package names to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package names is already up-to-date!
[nltk_data]    | Downloading package nombank.1.0 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package nombank.1.0 is already up-to-date!
[nltk_data]    | Downloading package nonbreaking_prefixes to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package nonbreaking_prefixes is already up-to-date!
[nltk_data]    | Downloading package nps_chat to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package nps_chat is already up-to-date!
[nltk_data]    | Downloading package omw to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package omw is already up-to-date!
[nltk_data]    | Downloading package omw-1.4 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package omw-1.4 is already up-to-date!
[nltk_data]    | Downloading package opinion_lexicon to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package opinion_lexicon is already up-to-date!
[nltk_data]    | Downloading package panlex_swadesh to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package panlex_swadesh is already up-to-date!
[nltk_data]    | Downloading package paradigms to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package paradigms is already up-to-date!
[nltk_data]    | Downloading package pe08 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package pe08 is already up-to-date!
[nltk_data]    | Downloading package perluniprops to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package perluniprops is already up-to-date!
[nltk_data]    | Downloading package pil to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package pil is already up-to-date!
[nltk_data]    | Downloading package pl196x to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package pl196x is already up-to-date!
[nltk_data]    | Downloading package porter_test to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package porter_test is already up-to-date!
[nltk_data]    | Downloading package ppattach to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package ppattach is already up-to-date!
[nltk_data]    | Downloading package problem_reports to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package problem_reports is already up-to-date!
[nltk_data]    | Downloading package product_reviews_1 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package product_reviews_1 is already up-to-date!
[nltk_data]    | Downloading package product_reviews_2 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package product_reviews_2 is already up-to-date!
[nltk_data]    | Downloading package propbank to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package propbank is already up-to-date!
[nltk_data]    | Downloading package pros_cons to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package pros_cons is already up-to-date!
[nltk_data]    | Downloading package ptb to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package ptb is already up-to-date!
[nltk_data]    | Downloading package punkt to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package punkt is already up-to-date!
[nltk_data]    | Downloading package qc to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package qc is already up-to-date!
[nltk_data]    | Downloading package reuters to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package reuters is already up-to-date!
[nltk_data]    | Downloading package rslp to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package rslp is already up-to-date!
[nltk_data]    | Downloading package rte to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package rte is already up-to-date!
[nltk_data]    | Downloading package sample_grammars to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package sample_grammars is already up-to-date!
[nltk_data]    | Downloading package semcor to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package semcor is already up-to-date!
[nltk_data]    | Downloading package senseval to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package senseval is already up-to-date!
[nltk_data]    | Downloading package sentence_polarity to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package sentence_polarity is already up-to-date!
[nltk_data]    | Downloading package sentiwordnet to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package sentiwordnet is already up-to-date!
[nltk_data]    | Downloading package shakespeare to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package shakespeare is already up-to-date!
[nltk_data]    | Downloading package sinica_treebank to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package sinica_treebank is already up-to-date!
[nltk_data]    | Downloading package smultron to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package smultron is already up-to-date!
[nltk_data]    | Downloading package snowball_data to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package snowball_data is already up-to-date!
[nltk_data]    | Downloading package spanish_grammars to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package spanish_grammars is already up-to-date!
[nltk_data]    | Downloading package state_union to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package state_union is already up-to-date!
[nltk_data]    | Downloading package stopwords to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package stopwords is already up-to-date!
[nltk_data]    | Downloading package subjectivity to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package subjectivity is already up-to-date!
[nltk_data]    | Downloading package swadesh to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package swadesh is already up-to-date!
[nltk_data]    | Downloading package switchboard to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package switchboard is already up-to-date!
[nltk_data]    | Downloading package tagsets to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package tagsets is already up-to-date!
[nltk_data]    | Downloading package timit to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package timit is already up-to-date!
[nltk_data]    | Downloading package toolbox to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package toolbox is already up-to-date!
[nltk_data]    | Downloading package treebank to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package treebank is already up-to-date!
[nltk_data]    | Downloading package twitter_samples to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package twitter_samples is already up-to-date!
[nltk_data]    | Downloading package udhr to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package udhr is already up-to-date!
[nltk_data]    | Downloading package udhr2 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package udhr2 is already up-to-date!
[nltk_data]    | Downloading package unicode_samples to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package unicode_samples is already up-to-date!
[nltk_data]    | Downloading package universal_tagset to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package universal_tagset is already up-to-date!
[nltk_data]    | Downloading package universal_treebanks_v20 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package universal_treebanks_v20 is already up-to-
[nltk_data]    |       date!
[nltk_data]    | Downloading package vader_lexicon to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package vader_lexicon is already up-to-date!
[nltk_data]    | Downloading package verbnet to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package verbnet is already up-to-date!
[nltk_data]    | Downloading package verbnet3 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package verbnet3 is already up-to-date!
[nltk_data]    | Downloading package webtext to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package webtext is already up-to-date!
[nltk_data]    | Downloading package wmt15_eval to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package wmt15_eval is already up-to-date!
[nltk_data]    | Downloading package word2vec_sample to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package word2vec_sample is already up-to-date!
[nltk_data]    | Downloading package wordnet to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package wordnet is already up-to-date!
[nltk_data]    | Downloading package wordnet2021 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package wordnet2021 is already up-to-date!
[nltk_data]    | Downloading package wordnet2022 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package wordnet2022 is already up-to-date!
[nltk_data]    | Downloading package wordnet31 to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package wordnet31 is already up-to-date!
[nltk_data]    | Downloading package wordnet_ic to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package wordnet_ic is already up-to-date!
[nltk_data]    | Downloading package words to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package words is already up-to-date!
[nltk_data]    | Downloading package ycoe to
[nltk_data]    |     C:\Users\user\AppData\Roaming\nltk_data...
[nltk_data]    |   Package ycoe is already up-to-date!
[nltk_data]    | 
[nltk_data]  Done downloading collection all
Out[3]:
True

2. Introducción a los datos¶

2.1. Parámetros generales y carga de información¶

In [4]:
#Porcentaje para validación y test
test_alpha = 0.2
#random_state o semilla para la reproducibilidad
my_seed = 19

2.2. Configuración del entorno de kaggle.¶

In [5]:
import os
import shutil

# Obtener la ruta del directorio del usuario
home_dir = os.path.expanduser("~")

# Crear el directorio .kaggle si no existe
kaggle_dir = os.path.join(home_dir, ".kaggle")
if not os.path.exists(kaggle_dir):
    os.makedirs(kaggle_dir)

# Copiar el archivo kaggle.json al directorio .kaggle
src_file = "kaggle.json"
dst_file = os.path.join(kaggle_dir, src_file)
shutil.copy(src_file, dst_file)

# Cambiar los permisos del archivo kaggle.json para que solo el usuario tenga acceso de lectura
os.chmod(dst_file, 0o600)

print("Configuración de la API de Kaggle completada.")
Configuración de la API de Kaggle completada.
In [6]:
!kaggle datasets list
Warning: Looks like you're using an outdated API Version, please consider updating (server 1.6.12 / client 1.6.6)
ref                                                  title                                                size  lastUpdated          downloadCount  voteCount  usabilityRating  
---------------------------------------------------  --------------------------------------------------  -----  -------------------  -------------  ---------  ---------------  
rahulvyasm/netflix-movies-and-tv-shows               Netflix Movies and TV Shows                           1MB  2024-04-10 09:48:38           3566         70  1.0              
sudarshan24byte/online-food-dataset                  Online Food Dataset                                   3KB  2024-03-02 18:50:30          30576        587  0.9411765        
nayanack/netflix                                     Netflix Chronicles: Exploring Movies and TV Shows     1MB  2024-04-16 07:36:08           1096         23  0.88235295       
mexwell/heart-disease-dataset                        🫀 Heart Disease Dataset                             399KB  2024-04-08 09:43:49           1876         33  1.0              
asaniczka/university-employee-salaries-2011-present  University Employee Salaries (2011 - Present)        17MB  2024-04-07 10:11:15           1572         45  1.0              
akankshaaa013/top-grossing-movies-dataset            Top Grossing Movies Dataset                          33KB  2024-04-08 08:29:47           1584         35  1.0              
prishasawhney/mushroom-dataset                       Mushroom Dataset (Binary Classification)            602KB  2024-04-18 19:56:44            462         46  1.0              
fatemehmehrparvar/obesity-levels                     Obesity Levels                                       58KB  2024-04-07 16:28:30           3169         55  0.88235295       
sukhmandeepsinghbrar/water-quality                   Water Quality                                        49MB  2024-04-19 07:53:13            329         32  1.0              
sakshisatre/social-advertisement-dataset             Social Media Consumer Buying Behavior Dataset         1KB  2024-04-14 08:47:43            942         30  1.0              
sunnykakar/spotify-charts-all-audio-data             Spotify Charts (All Audio Data)                       3GB  2024-04-15 20:15:15            889         31  1.0              
arnavsmayan/amazon-prime-userbase-dataset            Amazon Prime Userbase Dataset                       104KB  2024-04-15 06:25:10           1139         28  1.0              
prishasawhney/good-reads-top-1000-books              Good Reads Dataset (Top 1000 Books)                  26KB  2024-04-17 20:02:53            266         44  1.0              
sahirmaharajj/employee-salaries-analysis             Employee Salaries Analysis                          101KB  2024-03-31 16:32:47           2339         58  1.0              
bhavikjikadara/student-study-performance             Student Study Performance                             9KB  2024-03-07 06:14:09          14401        178  1.0              
anandshaw2001/customer-churn-dataset                 Customer Churn Dataset                              262KB  2024-04-09 18:41:58           1100         27  1.0              
startalks/pii-models                                 pii-models                                            1GB  2024-03-21 21:23:40            181         24  1.0              
sanyamgoyal401/customer-purchases-behaviour-dataset  Customer Purchases Behaviour Dataset                  1MB  2024-04-06 18:42:01           2264         46  1.0              
varunraskar/cancer-regression                        Cancer Regression                                   339KB  2024-04-14 12:58:28            661         22  0.9411765        
susanta21/student-attitude-and-behavior              Student Attitude and Behavior                         5KB  2024-04-13 12:16:32           1148         29  1.0              
In [7]:
!kaggle datasets download banuprakashv/news-articles-classification-dataset-for-nlp-and-ml
news-articles-classification-dataset-for-nlp-and-ml.zip: Skipping, found more recently modified local copy (use --force to force download)
In [9]:
ROOT_DIR ='C:\\Users\\user\\BI-Sabroson\\Machine-Learning-Labs\\Talleres del Santi\\Taller 3'
DATASET_NAME = 'news-articles-classification-dataset-for-nlp-and-ml'
In [10]:
print(f"!unzip {DATASET_NAME}.zip -d {ROOT_DIR}/{DATASET_NAME}")
!unzip news-articles-classification-dataset-for-nlp-and-ml.zip -d C:\Users\user\BI-Sabroson\Machine-Learning-Labs\Talleres del Santi\Taller 3/news-articles-classification-dataset-for-nlp-and-ml
In [11]:
import zipfile
#imprimir directorio actual
print(os.getcwd())
# Cambiar al directorio ROOT_DIR
os.chdir(ROOT_DIR)

# Crear el directorio DATASET_NAME
dataset_dir = os.path.join(ROOT_DIR, DATASET_NAME)
os.makedirs(dataset_dir, exist_ok=True)

# Descomprimir el archivo DATASET_NAME.zip en el directorio DATASET_NAME
zip_file = os.path.join(ROOT_DIR, f"{DATASET_NAME}.zip")
with zipfile.ZipFile(f"{DATASET_NAME}.zip", 'r') as zip_ref:
    zip_ref.extractall(dataset_dir)

print("Descompresión completada.")
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\Talleres del Santi\Taller 3
Descompresión completada.
In [12]:
DATA_DIR = f"{ROOT_DIR}/{DATASET_NAME}"
print(DATA_DIR)
C:\Users\user\BI-Sabroson\Machine-Learning-Labs\Talleres del Santi\Taller 3/news-articles-classification-dataset-for-nlp-and-ml

2.3. Separación de la información¶

In [13]:
csv_files = os.listdir(DATA_DIR)

train_df = pd.DataFrame()
test_df = pd.DataFrame()

for csv_file in csv_files:
  new_df = pd.read_csv(osp.join(DATA_DIR, csv_file))
  train, test = train_test_split(new_df, test_size=test_alpha, random_state=my_seed)
  train_df = pd.concat([train_df, train])
  test_df = pd.concat([test_df, test])

train_df.head()
Out[13]:
headlines description content url category
636 Gold Silver Rates Today: Precious metals price... In Chennai, 24-carat gold per 10 gram was sell... Gold Silver Rates Today (November 1): Precious... https://indianexpress.com/article/business/com... business
161 India’s forex reserves jump USD 2.75 bn to USD... Gold reserves were up by USD 853 million to US... India’s forex reserves jumped by USD 2.759 bil... https://indianexpress.com/article/business/ind... business
855 From capital to people, a lot at stake for Ind... Over 1,600 people have been killed so far sinc... A wide range of Indian businesses are closely ... https://indianexpress.com/article/business/fro... business
24 Q3 Results: IOC, DLF, Bajaj Auto, TVS Motor re... Q3 Results: Most companies managed their perfo... Investors will continue their focus on earning... https://indianexpress.com/article/business/com... business
252 India says IMF debt warning a worst case scenario The IMF, in a so-called article IV review, sai... The Indian government said on Friday a warning... https://indianexpress.com/article/business/eco... business

A continuación se muestra la separación de los datos en ambos sets de entrenamiento y de evaluación.

In [14]:
train_count = train_df.shape[0]
test_count = test_df.shape[0]

print("-------------------SEPARACIÓN DE LA INFORMACIÓN-------------------")
print(f"-> Train: {train_count:,}")
print(f"-> Test: {test_count:,}")
-------------------SEPARACIÓN DE LA INFORMACIÓN-------------------
-> Train: 8,000
-> Test: 2,000

Como se puede observar, el dataset original parece contener 10000 datos, separados en una proporción 80% train y 20% test

2.3.1. Revisión de categorías¶

Es necesario revisar que tan balanceadas están las categorías tanto para los datos de entrenamiento como para los de evaluación.

In [15]:
plt.title("Categorias en set de entrenamiento")
train_df.groupby('category').size().plot(kind='barh', color=sns.palettes.mpl_palette('Dark2'))
plt.gca().spines[['top', 'right',]].set_visible(False)
In [16]:
plt.title("Categorias en set de evaluación")
test_df.groupby('category').size().plot(kind='barh', color=sns.palettes.mpl_palette('Dark2'))
plt.gca().spines[['top', 'right',]].set_visible(False)

Luego de graficar ambos datasets es posible decir que en ambos casos las clases se encuentran balanceadas y que cuentan con 5 diferentes tipos de categorías: tecnología, deportes, entretenimiento, educación y negocio.

Se definen las variables a utilizar para la red neuronal.

In [19]:
target_feature = 'category'
x_feature = 'content'

2.4. Exploración de los datos.¶

Se utilizará WordCloud para poder visualizar las palabras más recurrentes dentro de el conjunto de datos.

In [20]:
def show_wordcloud(palabras,stopwords=[]):
    comment_words = ''

    # iterate through the csv file
    for val in palabras:

        # typecaste each val to string
        val = str(val)

        # split the value
        tokens = val.split()

        # Converts each token into lowercase
        for i in range(len(tokens)):
            tokens[i] = tokens[i].lower()

        comment_words += " ".join(tokens)+" "

    wordcloud = WordCloud(width = 800, height = 800,
                    background_color ='white',
                    stopwords = stopwords,
                    min_font_size = 10).generate(comment_words)

    # plot the WordCloud image
    plt.figure(figsize = (8, 8), facecolor = None)
    plt.imshow(wordcloud)
    plt.axis("off")
    plt.tight_layout(pad = 0)

    plt.show()
In [21]:
for i in train_df[target_feature].unique():
    print(f'---------- Words for class: {i} ----------')
    show_wordcloud(train_df.loc[train_df[target_feature]==i, x_feature])
---------- Words for class: business ----------
---------- Words for class: education ----------
---------- Words for class: entertainment ----------
---------- Words for class: sports ----------
---------- Words for class: technology ----------

Después de realizar la visualización de los datos, se evidencia la necesidad de eliminar las stopwords, palabras comunes que no añaden significado al análisis de texto. La librería NLTK provee herramientas para este fin, permitiendo filtrar palabras según una lista predefinida de stopwords. Esto mejora la calidad del análisis al enfocarse en palabras relevantes, como sustantivos y adjetivos, facilitando la extracción de información importante del texto.

Sin embargo, como las stopwords son altamente sensibles al idioma del texto que se va a tratar, hay que revisar que todos los datos se encuentren en inglés.

*Esto se revisó desde Google Colab pero tuvo que quitarse al pasarse a local debido a problemas con la librería Polyglot y que en Colab se acabaron los creditos para usar la GPU *

Se confirma que todos los datos están en inglés y por lo tanto se pueden eliminar las stopwords con la seguridad de que será hecho de manera efectiva para el idioma inglés.

In [22]:
stop_words = stopwords.words('english')
for i in train_df[target_feature].unique():
    print(f'---------- Words for class: {i} ----------')
    show_wordcloud(train_df.loc[train_df[target_feature]==i, x_feature], stop_words)
---------- Words for class: business ----------
---------- Words for class: education ----------
---------- Words for class: entertainment ----------
---------- Words for class: sports ----------
---------- Words for class: technology ----------

2.5 Preparación de la información¶

Dentro del preprocesamiento de los datos se han decidido realizar las siguientes cuatro acciones:

  1. Codificación de las temáticas.
  2. Eliminación de ruido
  3. Tokenización
  4. Normalización

    Estas transformaciones permiten que los datos queden en un formato estructurado y listo para ser procesados por la red neuronal, cumpliendo con estándares de calidad como la completitud, la consistencia, la exactitud y la relevancia. Además, estas acciones facilitan el aprendizaje de la red neuronal, mejoran la precisión, reducen el tiempo de entrenamiento y aumentan la generalización, lo que se traduce en un mejor rendimiento y una mayor confiabilidad del modelo de aprendizaje automático.

2.5.1. Codificación de las temáticas¶

Es crucial que las categorías se representen de manera numérica en análisis de datos y aprendizaje automático, ya que muchos algoritmos requieren datos numéricos para operar de manera efectiva. Cuando las categorías están en formato no numérico, como texto o cadenas, es necesario transformarlas a valores numéricos para poder utilizarlas en modelos predictivos. Esta transformación es esencial para garantizar que el modelo pueda interpretar y aprender de los datos correctamente.

In [23]:
label_encoder = LabelEncoder()
train_df[target_feature] = label_encoder.fit_transform(train_df[target_feature])
test_df[target_feature] = label_encoder.fit_transform(test_df[target_feature])

unique_labels = label_encoder.classes_
for num_value, original_label in enumerate(unique_labels):
    print(f'Valor numérico: {num_value}, Etiqueta original: {original_label}')
Valor numérico: 0, Etiqueta original: business
Valor numérico: 1, Etiqueta original: education
Valor numérico: 2, Etiqueta original: entertainment
Valor numérico: 3, Etiqueta original: sports
Valor numérico: 4, Etiqueta original: technology

Separación de Variable objetivo y contenido¶

In [24]:
X_train, Y_train = train_df[x_feature], train_df[target_feature]
X_test, Y_test = test_df[x_feature], test_df[target_feature]
display(X_train)
Y_train
636     Gold Silver Rates Today (November 1): Precious...
161     India’s forex reserves jumped by USD 2.759 bil...
855     A wide range of Indian businesses are closely ...
24      Investors will continue their focus on earning...
252     The Indian government said on Friday a warning...
                              ...                        
936     Apart from stopping yourself from clicking on ...
1378    Japan, which had to put off the launch of its ...
757     Apple has been testing iOS 17.2 for quite a wh...
622     Following the success of the Chandrayaan-3 mis...
1629    Hot Jupiters are curious cosmic bodies. They a...
Name: content, Length: 8000, dtype: object
Out[24]:
636     0
161     0
855     0
24      0
252     0
       ..
936     4
1378    4
757     4
622     4
1629    4
Name: category, Length: 8000, dtype: int32

2.5.2. Eliminación de ruido¶

La eliminación de ruido es fundamental al trabajar en la clasificación de textos, ya que permite mejorar la precisión y eficacia del modelo. Al filtrar información irrelevante, como palabras vacías, errores ortográficos o caracteres especiales, se optimiza el procesamiento de los datos, lo que conduce a una mejor comprensión del contenido. Además, al reducir la interferencia de factores externos, como el ruido ambiental o la variabilidad en la forma de expresión, se incrementa la capacidad del modelo para identificar patrones significativos y tomar decisiones más precisas en la clasificación de textos.

In [25]:
def remove_non_ascii(words):
    """Remove non-ASCII characters from list of tokenized words"""
    new_words = []
    for word in words:
        new_word = unicodedata.normalize('NFKD', word).encode('ascii', 'ignore').decode('utf-8', 'ignore')
        new_words.append(new_word)
    return new_words

def to_lowercase(words):
    """Convert all characters to lowercase from list of tokenized words"""
    new_words = []
    for word in words:
        new_word = word.lower()
        new_words.append(new_word)
    return new_words

def remove_punctuation(words):
    """Remove punctuation from list of tokenized words"""
    new_words = []
    for word in words:
        new_word = re.sub(r'[^\w\s]', '', word)
        if new_word != '':
            new_words.append(new_word)
    return new_words

def replace_numbers(words):
    """Replace all interger occurrences in list of tokenized words with textual representation"""
    p = inflect.engine()
    new_words = []
    for word in words:
        if word.isdigit():
            new_word = p.number_to_words(word)
            new_words.append(new_word)
        else:
            new_words.append(word)
    return new_words

def remove_stopwords(words, stopwords=stopwords.words('english')):
    """Remove stop words from list of tokenized words"""
    new_words = []
    for word in words:
        if word not in stopwords:
            new_words.append(word)
    return new_words

def preproccesing(words):
    words = to_lowercase(words)
    words = replace_numbers(words)
    words = remove_punctuation(words)
    words = remove_non_ascii(words)
    words = remove_stopwords(words)
    return words

2.5.3. Tokenización.¶

La tokenización es un paso crucial en el procesamiento de texto que ofrece diversas ventajas al trabajar en la clasificación de textos. Esta transformación facilita el análisis y la extracción de características relevantes para la clasificación. Esto permite una representación más estructurada y uniforme del texto, lo que a su vez mejora la capacidad del modelo para capturar la semántica y el contexto.

In [26]:
X_train_new = X_train.apply(word_tokenize)
X_train_new = X_train_new.apply(preproccesing) #Aplica la eliminación del ruido
X_train_new.head()
Out[26]:
636    [gold, silver, rates, today, november, one, pr...
161    [india, forex, reserves, jumped, usd, 2759, bi...
855    [wide, range, indian, businesses, closely, mon...
24     [investors, continue, focus, earning, wednesda...
252    [indian, government, said, friday, warning, in...
Name: content, dtype: object
In [27]:
X_train_trans = X_train_new.copy()
X_train_trans['token_count'] = X_train_trans.apply(lambda x: len(x))
X_train_trans['token_count'].mean()
Out[27]:
134.212625

Hay un promedio de 134.21 tokens por cada registro en el conjunto de datos.

2.5.4. Normalización.¶

La normalización en el procesamiento de texto involucra técnicas como Stemming y Lemmatizing, que son fundamentales cuando se quiere que un modelo analice textos con muchas palabras únicas. El Stemming reduce las palabras a su raíz, simplificando la representación y reduciendo la dimensionalidad del espacio de características. Por otro lado, el Lemmatizing va más allá al reducir las palabras a su forma base, considerando la morfología y la gramática del idioma para proporcionar una representación más precisa y coherente del texto. Juntos, estos enfoques optimizan la calidad y eficiencia de los modelos de clasificación al mejorar la coherencia y la representación del texto.

In [28]:
def stem_words(words):
    """Stem words in list of tokenized words"""
    stemmer = SnowballStemmer('english')
    stems = []
    for word in words:
        stem = stemmer.stem(word)
        stems.append(stem)
    return stems

def lemmatize_verbs(words):
    """Lemmatize verbs in list of tokenized words"""
    lemmatizer = WordNetLemmatizer()
    lemmas = []
    for word in words:
        lemma = lemmatizer.lemmatize(word, pos='v')
        lemmas.append(lemma)
    return lemmas

def stem_and_lemmatize(words):
    words = stem_words(words)
    words = lemmatize_verbs(words)
    return words
In [29]:
X_train_new = X_train_new.apply(stem_and_lemmatize) #Aplica lematización y Eliminación de Prefijos y Sufijos.
X_train_new.head()
Out[29]:
636    [gold, silver, rate, today, novemb, one, preci...
161    [india, forex, reserv, jump, usd, 2759, billio...
855    [wide, ring, indian, busi, close, monitor, ong...
24     [investor, continu, focus, earn, wednesday, se...
252    [indian, govern, say, friday, warn, intern, mo...
Name: content, dtype: object

Se actualiza el conjunto de datos de entrenamiento

In [30]:
train_df['trans'] = X_train_new.apply(lambda x: ' '.join(map(str, x)))
train_df.head()
Out[30]:
headlines description content url category trans
636 Gold Silver Rates Today: Precious metals price... In Chennai, 24-carat gold per 10 gram was sell... Gold Silver Rates Today (November 1): Precious... https://indianexpress.com/article/business/com... 0 gold silver rate today novemb one precious met...
161 India’s forex reserves jump USD 2.75 bn to USD... Gold reserves were up by USD 853 million to US... India’s forex reserves jumped by USD 2.759 bil... https://indianexpress.com/article/business/ind... 0 india forex reserv jump usd 2759 billion usd 6...
855 From capital to people, a lot at stake for Ind... Over 1,600 people have been killed so far sinc... A wide range of Indian businesses are closely ... https://indianexpress.com/article/business/fro... 0 wide ring indian busi close monitor ongo confl...
24 Q3 Results: IOC, DLF, Bajaj Auto, TVS Motor re... Q3 Results: Most companies managed their perfo... Investors will continue their focus on earning... https://indianexpress.com/article/business/com... 0 investor continu focus earn wednesday sever he...
252 India says IMF debt warning a worst case scenario The IMF, in a so-called article IV review, sai... The Indian government said on Friday a warning... https://indianexpress.com/article/business/eco... 0 indian govern say friday warn intern monetari ...

Vectorización¶

La técnica Term Frequency-Inverse Document Frequency (TF-IDF) es crucial en la clasificación de textos debido a su capacidad para resaltar la importancia relativa de las palabras en un documento dentro de un corpus más amplio. La frecuencia de término (TF) mide la relevancia de una palabra en un documento específico, mientras que la inversa de la frecuencia del documento (IDF) evalúa la rareza de un término en el conjunto de documentos. Esta técnica reduce la influencia de palabras comunes y resalta aquellas que son más descriptivas y específicas del contenido del documento, lo que mejora la capacidad del modelo para capturar la semántica y el contexto en la clasificación de textos.

In [31]:
tfidf_vect = TfidfVectorizer()
In [32]:
X_train_new_v = X_train_new.apply(lambda words: ' '.join(words))
X_tfidf = tfidf_vect.fit_transform(X_train_new_v)
In [33]:
terms = tfidf_vect.get_feature_names_out()
print(f"El número de columnas es: {len(terms)}")
terms
tfidf_df = pd.DataFrame(X_tfidf.toarray(), columns=terms)
tfidf_df
El número de columnas es: 43713
Out[33]:
00 000 001 002 003 004 005 006 007 008 ... zuckerberg zuckerbergl zulfon zulili zulkifli zurich zve10 zverev zwischenahn zyada
0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
7995 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7996 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7997 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7998 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7999 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0

8000 rows × 43713 columns

Componentes principales¶

Claramente tener 43713 columnas no es óptimo para lograr un modelo que generalice de manera correcta.

La razón para usar PCA en este contexto es que ayuda a visualizar la estructura de los datos y a detectar patrones o agrupaciones. Fijar un número de componentes permite controlar cuánta información se conserva en la proyección. Al fijar un número de componentes, se reduce la dimensionalidad del espacio de características, lo que facilita la visualización y la interpretación de los datos. Sin embargo, es importante elegir un número adecuado de componentes para evitar perder demasiada información o introducir ruido innecesario en la representación.

In [34]:
#La función grafica el último de los componentes identificados con sus respectivas clases
def draw_components(labels, X, Y, n_components):
  # Inicializar LSA (TruncatedSVD), similar a PCA pero para matrices dispersas
  pca = TruncatedSVD(n_components=n_components)

  if n_components < 2:
    raise("El número de componentes no puede ser menor a 2")

  # Ajustar y transformar los datos TF-IDF
  X_pca = pca.fit_transform(X)
  print(X_pca.shape)
  print("Varianza explicada: ", sum(pca.explained_variance_ratio_))
  #Paleta de colores
  colors = plt.cm.viridis(np.linspace(0, 1, len(labels)))
  label_color_dict = dict(zip(labels, colors))

  # Asignar un color a cada etiqueta
  label_colors = [label_color_dict[label_encoder.inverse_transform([label])[0]] for label in Y]

  # Gráfico
  plt.figure(figsize=(10, 7))
  scatter = plt.scatter(X_pca[:, 0], X_pca[:, n_components-1], c=label_colors, alpha=0.5)

  #Leyenda
  handles = [plt.Line2D([0], [0], marker='o', color=color, linewidth=0, markersize=10) for label, color in label_color_dict.items()]
  plt.legend(handles, labels, title='Leyenda')
  plt.show()
In [35]:
draw_components(unique_labels, tfidf_df, Y_train, 2)
(8000, 2)
Varianza explicada:  0.016128159076136343
In [74]:
draw_components(unique_labels, tfidf_df, Y_train, 20)
(8000, 20)
Varianza explicada:  0.09793489887718093
In [57]:
draw_components(unique_labels, tfidf_df, Y_train, 100)
(8000, 100)
Varianza explicada:  0.2087917726315192
In [58]:
draw_components(unique_labels, tfidf_df, Y_train, 1000)
(8000, 1000)
Varianza explicada:  0.5718193261774015
In [37]:
draw_components(unique_labels, tfidf_df, Y_train, 8000)
(8000, 8000)
Varianza explicada:  1.0000000000000056

Como se puede observar, al sacar 8000 componentes principales, la varianza explicada por todos los componentes obtenidos es del 100%, como la idea es reducir al máximo el número de componentes principales se está intentando encontrar el mínimo número de componentes principales que permitirá tener por lo menos un 95% de la variabilidad explicada.

Dicho eso, es claro que se puede disminuir un poco más el número de componentes principales.

In [75]:
draw_components(unique_labels, tfidf_df, Y_train, 6000)
(8000, 6000)
Varianza explicada:  0.9742005013190539

Ya se redujo en 2000 componentes y todavía se explica el 97% de la variabilidad, es decir que todavía se puede reducir un poco más.

In [76]:
draw_components(unique_labels, tfidf_df, Y_train, 5000)
(8000, 5000)
Varianza explicada:  0.945928984592642

Parece ser que la explicación de la varianza está muy cerca del 95%, sin embargo como está por debajo hay que aumentar ligeramente la cantidad de componentes principales.

In [77]:
draw_components(unique_labels, tfidf_df, Y_train, 5100)
(8000, 5100)
Varianza explicada:  0.9493399646059367
In [36]:
draw_components(unique_labels, tfidf_df, Y_train, 3500)
(8000, 3500)
Varianza explicada:  0.8739307706991458
In [37]:
draw_components(unique_labels, tfidf_df, Y_train, 3000)
(8000, 3000)
Varianza explicada:  0.8384164985157284
In [38]:
draw_components(unique_labels, tfidf_df, Y_train, 2500)
(8000, 2500)
Varianza explicada:  0.7946439094417896
In [39]:
draw_components(unique_labels, tfidf_df, Y_train, 2000)
(8000, 2000)
Varianza explicada:  0.7397876404584564
In [41]:
draw_components(unique_labels, tfidf_df, Y_train, 1700)
(8000, 1700)
Varianza explicada:  0.6995880954399445

Tabla de resultados¶

Cantidad de Componentes Principales Explicabilidad de Varianza
2 1.6%
20 9.8%
100 20.9%
1000 57.2%
1700 69.9%
2000 73.9%
2500 79.4%
3000 83.8%
3500 87.4%
5000 94.6%
5100 94.9%
6000 97.4%
8000 100%

Luego de revisar los resultados de la tabla.Es posible observar que aunque inicialmente se logró explicar el 95% de la variabilidad utilizando 5100 columnas, pero es posible que reducir ligeramente la explicabilidad podría eliminar el ruido y mejorar la capacidad de generalización del modelo. Por lo tanto, se planea explorar diferentes niveles de explicabilidad, como conformarse solo con 80% o incluso el 70%, mediante la reducción del número de componentes. Para determinar el mejor equilibrio entre el número de componentes y la precisión del modelo, se tiene la intención de implementar tres algoritmos base. Este enfoque permitirá identificar el punto óptimo que maximice la capacidad de generalización y la precisión del modelo, al tiempo que reduce la dimensionalidad y mitigar el impacto del ruido en los datos iniciales. De esta manera, se ha encontrado el grupo de números de componentes principales para realizar los algoritmos bases: 1700, 3000 y 5100.

3. Modelamiento¶

3.1. Preparación de los datos¶

A continuación se creará la clase que contendrá todos los preprocesamientos necesarios.

Importante: El código implementado abajo realiza un proceso de preprocesamiento de texto seguido de una transformación TF-IDF y una reducción de dimensionalidad mediante PCA para preparar los datos para su alimentación a una red neuronal.

Para garantizar la consistencia en la dimensionalidad de entrada de la red neuronal, se utiliza la técnica de padding con ceros, lo que asegura que todas las muestras tengan la misma dimensión, independientemente del tamaño del conjunto de datos (Como pasa en el caso de el conjunto de test). Esta decisión se justifica tanto por la necesidad de mantener la coherencia en los datos durante el entrenamiento de la red como por la arquitectura de la red neuronal, que requiere una dimensión de entrada uniforme para un procesamiento eficiente. Esto asegura que la red pueda entrenarse de manera efectiva y que los datos se procesen de manera uniforme, lo que contribuye a un mejor rendimiento del modelo.

In [57]:
class TextPreprocessing:
    def __init__(self,stopwords=stopwords.words('english')):
        self.stopwords = stopwords
        self.max_words = 10000
        self.tfidf_vect = TfidfVectorizer(max_features=self.max_words)
        self.pca = TruncatedSVD(n_components=100)

    def remove_non_ascii(self, words):
        """Remove non-ASCII characters from list of tokenized words"""
        new_words = []
        for word in words:
            new_word = unicodedata.normalize('NFKD', word).encode('ascii', 'ignore').decode('utf-8', 'ignore')
            new_words.append(new_word)
        return new_words

    def to_lowercase(self, words):
        """Convert all characters to lowercase from list of tokenized words"""
        new_words = []
        for word in words:
            new_word = word.lower()
            new_words.append(new_word)
        return new_words

    def remove_punctuation(self, words):
        """Remove punctuation from list of tokenized words"""
        new_words = []
        for word in words:
            new_word = re.sub(r'[^\w\s]', '', word)
            if new_word != '':
                new_words.append(new_word)
        return new_words

    def replace_numbers(self, words):
        """Replace all interger occurrences in list of tokenized words with textual representation"""
        p = inflect.engine()
        new_words = []
        for word in words:
            if word.isdigit():
                new_word = p.number_to_words(word)
                new_words.append(new_word)
            else:
                new_words.append(word)
        return new_words

    def remove_stopwords(self, words):
        """Remove stop words from list of tokenized words"""
        new_words = []
        for word in words:
            if word not in self.stopwords:
                new_words.append(word)
        return new_words

    def stem_words(self, words):
        """Stem words in list of tokenized words"""
        stemmer = SnowballStemmer('spanish')
        stems = []
        for word in words:
            stem = stemmer.stem(word)
            stems.append(stem)
        return stems

    def lemmatize_verbs(self, words):
        """Lemmatize verbs in list of tokenized words"""
        lemmatizer = WordNetLemmatizer()
        lemmas = []
        for word in words:
            lemma = lemmatizer.lemmatize(word, pos='v')
            lemmas.append(lemma)
        return lemmas

    def stem_and_lemmatize(self, words):
        words = self.stem_words(words)
        words = self.lemmatize_verbs(words)
        return words

    def preproccesing(self, words):
        words = self.to_lowercase(words)
        words = self.replace_numbers(words)
        words = self.remove_punctuation(words)
        words = self.remove_non_ascii(words)
        words = self.remove_stopwords(words)
        return words

    def transform(self,X, is_train, n_components):
        X_train_new = pd.Series(X)
        X_train_new = X_train_new.apply(contractions.fix)
        X_train_new = X_train_new.apply(word_tokenize)
        X_train_new = X_train_new.apply(lambda x: self.preproccesing(x))
        X_train_new = X_train_new.apply(lambda x: self.stem_words(x))
        X_train_new = X_train_new.apply(lambda x: ' '.join(map(str, x)))

        if is_train:
            X_tfidf = self.tfidf_vect.fit_transform(X_train_new)
            self.pca = TruncatedSVD(n_components=n_components)
            X_pca = self.pca.fit_transform(X_tfidf)
        else:
            X_tfidf = self.tfidf_vect.transform(X_train_new)
            X_pca = self.pca.transform(X_tfidf)

        return X_pca

Luego de construir la clase se creará la variable del pipeline.

In [58]:
pipeline5100 = TextPreprocessing()
pipeline3000 = TextPreprocessing()
pipeline1700 = TextPreprocessing()

Se aplica ahora el pipeline a la variable X_train y al X_test para los diferentes números de componentes

In [59]:
X_train_p_5100 = pipeline5100.transform(X_train, is_train=True, n_components=5100)
print(f"El tamaño es: {X_train_p_5100.shape}")
X_train_p_5100
El tamaño es: (8000, 5100)
Out[59]:
array([[ 2.33922080e-01,  1.31247688e-01,  1.29150591e-01, ...,
         3.83071873e-04, -1.81761921e-03, -3.80619541e-04],
       [ 1.40489678e-01,  1.11609326e-01,  7.81257806e-02, ...,
         9.36361213e-04, -1.61788771e-03, -6.02776232e-04],
       [ 1.46370307e-01,  7.62418548e-02,  1.33796469e-02, ...,
        -5.80696087e-03,  6.88744570e-03, -8.77516435e-03],
       ...,
       [ 1.42712216e-01, -7.78335298e-02,  8.81215183e-03, ...,
         1.58652025e-03, -1.96998086e-03, -8.10450624e-04],
       [ 1.72146162e-01,  2.30874242e-02, -6.91681604e-02, ...,
        -2.10605619e-04, -3.03561717e-03,  2.25113218e-03],
       [ 8.74686615e-02, -6.41265008e-03, -2.18219202e-02, ...,
        -2.89801995e-03,  1.93884474e-04, -8.69697973e-04]])
In [60]:
X_test_p_5100 = pipeline5100.transform(X_test, is_train=False, n_components=5100)
print(f"El tamaño es: {X_test_p_5100.shape}")
X_test_p_5100
El tamaño es: (2000, 5100)
Out[60]:
array([[ 0.26466943,  0.38544188,  0.40960988, ...,  0.00614996,
         0.00329459,  0.00368363],
       [ 0.15139362,  0.05710875,  0.03571389, ...,  0.01565296,
         0.0006136 ,  0.01218145],
       [ 0.18861376,  0.1519424 ,  0.23431259, ..., -0.00617281,
        -0.00086582, -0.00177212],
       ...,
       [ 0.15161715, -0.02771074, -0.01228921, ..., -0.00545019,
         0.00694453,  0.01365117],
       [ 0.12271026, -0.00317327, -0.0028614 , ..., -0.00234666,
        -0.01025236, -0.01235204],
       [ 0.14617112,  0.01080924, -0.01822378, ..., -0.00671168,
        -0.00253222,  0.01218919]])
In [61]:
X_train_p_3000 = pipeline3000.transform(X_train, is_train=True, n_components=3000)
print(f"El tamaño es: {X_train_p_3000.shape}")
X_train_p_3000
El tamaño es: (8000, 3000)
Out[61]:
array([[ 0.23392208,  0.13124769,  0.12915059, ..., -0.0004145 ,
        -0.00047416,  0.01585869],
       [ 0.14048968,  0.11160933,  0.07812578, ...,  0.0026764 ,
         0.00409704,  0.00084192],
       [ 0.14637031,  0.07624185,  0.01337965, ..., -0.000559  ,
         0.01381171,  0.00510932],
       ...,
       [ 0.14271222, -0.07783353,  0.00881215, ..., -0.00060358,
         0.00948086,  0.0144636 ],
       [ 0.17214616,  0.02308742, -0.06916816, ..., -0.01642131,
         0.00256817,  0.02176338],
       [ 0.08746866, -0.00641265, -0.02182192, ...,  0.00211873,
        -0.00214609, -0.00166762]])
In [62]:
X_test_p_3000 = pipeline3000.transform(X_test, is_train=False, n_components=5100)
print(f"El tamaño es: {X_test_p_3000.shape}")
X_test_p_3000
El tamaño es: (2000, 3000)
Out[62]:
array([[ 2.64669427e-01,  3.85441877e-01,  4.09609879e-01, ...,
        -2.89037672e-03, -4.27271768e-04,  6.61795876e-04],
       [ 1.51393616e-01,  5.71087537e-02,  3.57138913e-02, ...,
        -1.02057472e-02,  3.84510167e-03,  1.62568956e-03],
       [ 1.88613757e-01,  1.51942400e-01,  2.34312586e-01, ...,
         1.31085008e-03, -3.70271191e-03,  1.21968891e-02],
       ...,
       [ 1.51617154e-01, -2.77107359e-02, -1.22892134e-02, ...,
        -3.51868545e-03, -1.14618070e-02, -3.28454406e-04],
       [ 1.22710257e-01, -3.17327322e-03, -2.86139573e-03, ...,
        -9.40711336e-03, -2.08886355e-03, -1.16681814e-02],
       [ 1.46171122e-01,  1.08092405e-02, -1.82237804e-02, ...,
        -4.51740775e-03, -1.23300333e-03, -1.42111130e-02]])
In [65]:
X_train_p_1700 = pipeline1700.transform(X_train, is_train=True, n_components=1700)
print(f"El tamaño es: {X_train_p_1700.shape}")
X_train_p_1700
El tamaño es: (8000, 1700)
Out[65]:
array([[ 0.23392208,  0.13124769,  0.12915059, ...,  0.00107393,
        -0.00650558,  0.00246164],
       [ 0.14048968,  0.11160933,  0.07812578, ..., -0.00098126,
         0.00132311,  0.00319363],
       [ 0.14637031,  0.07624185,  0.01337965, ...,  0.02128245,
         0.00619049, -0.00525248],
       ...,
       [ 0.14271222, -0.07783353,  0.00881215, ..., -0.01298731,
        -0.00745993,  0.00362367],
       [ 0.17214616,  0.02308742, -0.06916816, ...,  0.00741997,
         0.00604218,  0.01136075],
       [ 0.08746866, -0.00641265, -0.02182192, ...,  0.0284003 ,
         0.0021205 ,  0.00895434]])
In [66]:
X_test_p_1700 = pipeline1700.transform(X_test, is_train=False, n_components=5100)
print(f"El tamaño es: {X_test_p_1700.shape}")
X_test_p_1700
El tamaño es: (2000, 1700)
Out[66]:
array([[ 0.26466943,  0.38544188,  0.40960988, ...,  0.00668125,
         0.00325233,  0.00858644],
       [ 0.15139362,  0.05710875,  0.03571389, ..., -0.00464378,
         0.00317825, -0.00769993],
       [ 0.18861376,  0.1519424 ,  0.23431259, ...,  0.00513497,
         0.00197944,  0.00369901],
       ...,
       [ 0.15161715, -0.02771074, -0.01228921, ...,  0.01180813,
        -0.00330885, -0.0015854 ],
       [ 0.12271026, -0.00317327, -0.0028614 , ..., -0.00680957,
         0.00095576, -0.00626612],
       [ 0.14617112,  0.01080924, -0.01822378, ...,  0.006876  ,
        -0.00098594, -0.00900724]])

3.2. Arquitectura de la red¶

A continuación se va a construir la red neuronal, la cual va a contar con una capa de entrada, una capa oculta y una capa de salida.

In [99]:
model = Sequential(name="Base_NN")

Capa de entrada¶

In [100]:
model.add(Dense(128, activation='relu', input_shape=(X_train_p_5100.shape[1],), name="Input_Layer"))
model.summary()
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
Model: "Base_NN"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Layer (type)                    ┃ Output Shape           ┃       Param # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ Input_Layer (Dense)             │ (None, 128)            │       652,928 │
└─────────────────────────────────┴────────────────────────┴───────────────┘
 Total params: 652,928 (2.49 MB)
 Trainable params: 652,928 (2.49 MB)
 Non-trainable params: 0 (0.00 B)

Capa oculta¶

In [101]:
model.add(Dense(64, activation='relu', name="Hidden_Layer"))
model.summary()
Model: "Base_NN"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Layer (type)                    ┃ Output Shape           ┃       Param # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ Input_Layer (Dense)             │ (None, 128)            │       652,928 │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ Hidden_Layer (Dense)            │ (None, 64)             │         8,256 │
└─────────────────────────────────┴────────────────────────┴───────────────┘
 Total params: 661,184 (2.52 MB)
 Trainable params: 661,184 (2.52 MB)
 Non-trainable params: 0 (0.00 B)

Capa de Salida¶

In [102]:
model.add(Dense(len(unique_labels), activation="softmax", name='Output_Layer'))
model.summary()
Model: "Base_NN"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Layer (type)                    ┃ Output Shape           ┃       Param # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ Input_Layer (Dense)             │ (None, 128)            │       652,928 │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ Hidden_Layer (Dense)            │ (None, 64)             │         8,256 │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ Output_Layer (Dense)            │ (None, 5)              │           325 │
└─────────────────────────────────┴────────────────────────┴───────────────┘
 Total params: 661,509 (2.52 MB)
 Trainable params: 661,509 (2.52 MB)
 Non-trainable params: 0 (0.00 B)

Demás configuraciones¶

Finalmente, se configuran las opciones de entrenamiento resantes. Se especifica el optimizador Adam para la actualización de los pesos del modelo durante el entrenamiento, la función de pérdida de entropía cruzada categórica dispersa para calcular la discrepancia entre las predicciones y las etiquetas verdaderas, y la métrica de precisión para evaluar el rendimiento del modelo.

In [103]:
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
model.summary()
Model: "Base_NN"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Layer (type)                    ┃ Output Shape           ┃       Param # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ Input_Layer (Dense)             │ (None, 128)            │       652,928 │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ Hidden_Layer (Dense)            │ (None, 64)             │         8,256 │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ Output_Layer (Dense)            │ (None, 5)              │           325 │
└─────────────────────────────────┴────────────────────────┴───────────────┘
 Total params: 661,509 (2.52 MB)
 Trainable params: 661,509 (2.52 MB)
 Non-trainable params: 0 (0.00 B)

Una vez configurada toda la red neuronal es posible entrenarla.

3.3 Entrenamiento¶

3.3.1. Red neuronal Base¶

In [104]:
early_stopping = EarlyStopping(monitor='val_loss', patience=10, verbose=1, restore_best_weights=True)
In [105]:
with tf.device('/device:GPU:0'):
  history = model.fit(X_train_p_5100, Y_train, validation_split=0.2, epochs=100, batch_size=32, verbose=2, callbacks=[early_stopping])

#Final metrics for accuracy in validation, print it
print(f"Accuracy: {history.history['accuracy'][-1]:.2f}")
print(f"Validation Accuracy: {history.history['val_accuracy'][-1]}")

#Final metrics for loss in validation, print it
print(f"Loss: {history.history['loss'][-1]:.2f}")
print(f"Validation Loss: {history.history['val_loss'][-1]}")
Epoch 1/100
200/200 - 1s - 5ms/step - accuracy: 0.8541 - loss: 0.7217 - val_accuracy: 0.0000e+00 - val_loss: 6.7149
Epoch 2/100
200/200 - 0s - 2ms/step - accuracy: 0.9994 - loss: 0.0115 - val_accuracy: 0.0000e+00 - val_loss: 7.4481
Epoch 3/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 0.0026 - val_accuracy: 0.0000e+00 - val_loss: 7.7607
Epoch 4/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 0.0013 - val_accuracy: 0.0000e+00 - val_loss: 7.9575
Epoch 5/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 7.7315e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.1150
Epoch 6/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 5.1583e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.2607
Epoch 7/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 3.6623e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.3707
Epoch 8/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 2.7167e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.4694
Epoch 9/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 2.0796e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.5582
Epoch 10/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 1.6314e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.6454
Epoch 11/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 1.3047e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.7193
Epoch 11: early stopping
Restoring model weights from the end of the best epoch: 1.
Accuracy: 1.00
Validation Accuracy: 0.0
Loss: 0.00
Validation Loss: 8.719269752502441
In [ ]:
with tf.device('/device:GPU:0'):
  history = model.fit(X_train_p_3000, Y_train, validation_split=0.2, epochs=100, batch_size=32, verbose=2, callbacks=[early_stopping])
In [131]:
with tf.device('/device:GPU:0'):
  history = model.fit(X_train_p_1700, Y_train, validation_split=0.2, epochs=100, batch_size=32, verbose=2, callbacks=[early_stopping])
Epoch 1/100
200/200 - 1s - 7ms/step - accuracy: 0.8597 - loss: 0.7085 - val_accuracy: 0.0000e+00 - val_loss: 6.6077
Epoch 2/100
200/200 - 0s - 2ms/step - accuracy: 0.9992 - loss: 0.0114 - val_accuracy: 0.0000e+00 - val_loss: 7.4789
Epoch 3/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 0.0025 - val_accuracy: 0.0000e+00 - val_loss: 7.7802
Epoch 4/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 0.0013 - val_accuracy: 0.0000e+00 - val_loss: 8.0498
Epoch 5/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 7.8322e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.2592
Epoch 6/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 5.2835e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.4279
Epoch 7/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 3.7839e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.5764
Epoch 8/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 2.8230e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.6823
Epoch 9/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 2.1724e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.7902
Epoch 10/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 1.7095e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.8772
Epoch 11/100
200/200 - 0s - 2ms/step - accuracy: 1.0000 - loss: 1.3688e-04 - val_accuracy: 0.0000e+00 - val_loss: 8.9616
Epoch 11: early stopping
Restoring model weights from the end of the best epoch: 1.

Ahora que el modelo ha terminado de entrenarse es necesario visualizar el comportamiento de la red neuronal. En específico se graficará el valor de pérdida del modelo.

In [106]:
plt.plot(history.history['loss'], label='Train')
plt.plot(history.history['val_loss'], label='Val')
plt.title('Training and validation loss')
plt.xlabel('Epochs')
plt.ylabel('Loss')
plt.legend()
plt.show()

También se graficará el accuracy del modelo.

In [133]:
plt.plot(history.history['accuracy'], label='Train')
plt.plot(history.history['val_accuracy'], label='Val')
plt.title('Training and validation accuracy')
plt.xlabel('Epochs')
plt.ylabel('Accuracy')
plt.legend()
plt.show()

Tras obtener las gráficas de accuracy y de loss es posible observar que hay un sobreajuste bastante importante entre el train y el validate. Por como se comporta el modelo usando el set de entrenamiento es claro que la red neuronal es demasiado compleja y se "aprende" los datos. Los resultados del entrenamiento muestran una marcada discrepancia entre la precisión y la pérdida en los conjuntos de entrenamiento y validación. Aunque el modelo logra una precisión cercana al 100% en el conjunto de entrenamiento, este rendimiento no se traduce en una generalización efectiva, como lo demuestra una precisión de 0% en el conjunto de validación. La alta pérdida en el conjunto de validación confirma la falta de generalización del modelo.

Aunque la detención temprana del entrenamiento en la undécima época indica un intento de mitigar el sobreajuste, los resultados sugieren la necesidad de abordar más eficazmente este problema mediante estrategias adicionales, como la regularización, para mejorar la capacidad de generalización del modelo. Esto significa que para mejorar las métricas es necesario buscar hiperparámetros que ayuden a simplificar la red neuronal o que cambien el comportamiento y método de decisión de la red neuronal.

Métricas para conjunto test¶

In [134]:
model_accuracy = model.evaluate(X_test_p, Y_test)
print("Model Accuracy:", model_accuracy)
63/63 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 0.3133 - loss: 2.7989
Model Accuracy: [3.4156370162963867, 0.3034999966621399]
In [107]:
def plot_confusion_matrix(y_true, y_pred, classes,
                          normalize=False,
                          title=None,
                          cmap=plt.cm.Blues,size=(10,10)):
    """
    This function prints and plots the confusion matrix.
    Normalization can be applied by setting `normalize=True`.
    """
    if not title:
        if normalize:
            title = 'Normalized confusion matrix'
        else:
            title = 'Confusion matrix, without normalization'

    # Compute confusion matrix
    cm = confusion_matrix(y_true, y_pred)

    if normalize:
        cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]
        print("Normalized confusion matrix")
    else:
        print('Confusion matrix, without normalization')



    fig, ax = plt.subplots(figsize=size)
    im = ax.imshow(cm, interpolation='nearest', cmap=cmap)
    ax.figure.colorbar(im, ax=ax)
    # We want to show all ticks...
    ax.set(xticks=np.arange(cm.shape[1]),
           yticks=np.arange(cm.shape[0]),
           # ... and label them with the respective list entries
           xticklabels=classes, yticklabels=classes,
           title=title,
           ylabel='True label',
           xlabel='Predicted label')

    # Rotate the tick labels and set their alignment.
    plt.setp(ax.get_xticklabels(), rotation=45, ha="right",
             rotation_mode="anchor")

    # Loop over data dimensions and create text annotations.
    fmt = '.2f' if normalize else 'd'
    thresh = cm.max() / 2.
    for i in range(cm.shape[0]):
        for j in range(cm.shape[1]):
            ax.text(j, i, format(cm[i, j], fmt),
                    ha="center", va="center",
                    color="white" if cm[i, j] > thresh else "black")
    fig.tight_layout()
    return ax

Nuevamente es posible evidenciar el sobreajuste del modelo y la incapacidad de clasificar los datos como de tipo technology.

3.3.2. Búsqueda de hiperparámetros¶

Ahora que se cuenta con el algoritmo base de la red neuronal, el enfoque se dirige hacia la optimización de su rendimiento a través de una búsqueda de hiperparámetros. Se ha observado que la red neuronal puede no generalizar adecuadamente para datos desconocidos, lo que sugiere que hay margen para mejorar su capacidad de clasificación y sobre todo reducir su complejidad. En esta fase de optimización, se explorará el tipo de optimizador a utilizar, la cantidad de neuronas en la capa oculta y los métodos de activación de la capa de entrada y oculta. La elección del optimizador es crucial ya que determina cómo se actualizan los pesos de la red durante el entrenamiento, lo que puede influir significativamente en la convergencia y la calidad de los resultados. Del mismo modo, la cantidad de neuronas en la capa oculta influye en la capacidad de la red para aprender representaciones más complejas y no lineales de los datos; como se vió a través de las gráficas de validación y de entrenamiento puede que sea recomendable reducir el número de neuronas presente en la capa oculta.

In [115]:
from scikeras.wrappers import KerasClassifier
from sklearn.model_selection import GridSearchCV
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

# Define la función para crear tu modelo
def create_model_5100(optimizer='adam', units=128, activation='relu'):
    model = Sequential(name="Hyp_NN_5100")
    model.add(Dense(128, activation=activation, input_shape=(X_train_p_5100.shape[1],), name="Input_Layer"))
    model.add(Dense(units=units, activation=activation, name="Hidden_Layer"))
    model.add(Dense(len(unique_labels), activation='softmax', name='Output_Layer'))
    model.compile(optimizer=optimizer, loss='sparse_categorical_crossentropy', metrics=['accuracy'])
    return model

def create_model_3000(optimizer='adam', units=128, activation='relu'):
    model = Sequential(name="Hyp_NN_3000")
    model.add(Dense(128, activation=activation, input_shape=(X_train_p_3000.shape[1],), name="Input_Layer"))
    model.add(Dense(units=units, activation=activation, name="Hidden_Layer"))
    model.add(Dense(len(unique_labels), activation='softmax', name='Output_Layer'))
    model.compile(optimizer=optimizer, loss='sparse_categorical_crossentropy', metrics=['accuracy'])
    return model

def create_model_1700(optimizer='adam', units=128, activation='relu'):
    model = Sequential(name="Hyp_NN_1700")
    model.add(Dense(128, activation=activation, input_shape=(X_train_p_1700.shape[1],), name="Input_Layer"))
    model.add(Dense(units=units, activation=activation, name="Hidden_Layer"))
    model.add(Dense(len(unique_labels), activation='softmax', name='Output_Layer'))
    model.compile(optimizer=optimizer, loss='sparse_categorical_crossentropy', metrics=['accuracy'])
    return model

# Crea el clasificador Keras para utilizarlo con GridSearchCV
keras_classifier_5100 = KerasClassifier(build_fn=create_model_5100, batch_size=20, verbose=2)
keras_classifier_3000 = KerasClassifier(build_fn=create_model_3000, batch_size=20, verbose=2)
keras_classifier_1700 = KerasClassifier(build_fn=create_model_1700, batch_size=20, verbose=2)

# Define los hiperparámetros que deseas buscar
param_dist = {
    'optimizer': ['adam', 'rmsprop', 'sgd', 'adagrad'],
    'model__activation': ['relu', 'sigmoid'],  # Cambié 'activation' de 'act'
    'model__units': [16, 32, 64, 128]
}

# Realiza la búsqueda de hiperparámetros utilizando GridSearchCV
grid_search = GridSearchCV(estimator=keras_classifier_5100, param_grid=param_dist, cv=3, verbose=2)

grid_result = grid_search.fit(X_train_p_5100, Y_train)
Fitting 3 folds for each of 32 candidates, totalling 96 fits
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7437 - loss: 0.9738
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=adam; total time=   1.4s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.7114 - loss: 0.9425
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=adam; total time=   1.4s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.8420 - loss: 0.8968
134/134 - 0s - 990us/step
[CV] END model__activation=relu, model__units=16, optimizer=adam; total time=   1.4s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.7812 - loss: 0.9056
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.8011 - loss: 0.8975
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=rmsprop; total time=   1.4s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.7540 - loss: 0.9172
134/134 - 0s - 996us/step
[CV] END model__activation=relu, model__units=16, optimizer=rmsprop; total time=   1.4s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.7772 - loss: 0.8779
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=sgd; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8200 - loss: 0.8916
134/134 - 0s - 979us/step
[CV] END model__activation=relu, model__units=16, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8384 - loss: 0.8860
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=sgd; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7780 - loss: 0.8713
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=adagrad; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7620 - loss: 0.9072
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=adagrad; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.8241 - loss: 0.8880
134/134 - 0s - 975us/step
[CV] END model__activation=relu, model__units=16, optimizer=adagrad; total time=   1.4s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.8279 - loss: 0.8083
134/134 - 0s - 994us/step
[CV] END model__activation=relu, model__units=32, optimizer=adam; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8312 - loss: 0.7948
134/134 - 0s - 971us/step
[CV] END model__activation=relu, model__units=32, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8309 - loss: 0.8142
134/134 - 0s - 964us/step
[CV] END model__activation=relu, model__units=32, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8230 - loss: 0.8129
134/134 - 0s - 952us/step
[CV] END model__activation=relu, model__units=32, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8564 - loss: 0.7785
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8618 - loss: 0.7929
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8194 - loss: 0.8112
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8391 - loss: 0.8063
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=sgd; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8101 - loss: 0.8012
134/134 - 0s - 979us/step
[CV] END model__activation=relu, model__units=32, optimizer=sgd; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8131 - loss: 0.8255
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8738 - loss: 0.7743
134/134 - 0s - 993us/step
[CV] END model__activation=relu, model__units=32, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8200 - loss: 0.8144
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=adagrad; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8207 - loss: 0.7119
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=adam; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8528 - loss: 0.7033
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=adam; total time=   1.4s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8472 - loss: 0.7192
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=adam; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8209 - loss: 0.7257
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.8217 - loss: 0.6985
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8333 - loss: 0.7189
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8584 - loss: 0.7163
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=sgd; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8472 - loss: 0.6999
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=sgd; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8320 - loss: 0.7133
134/134 - 0s - 986us/step
[CV] END model__activation=relu, model__units=64, optimizer=sgd; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8586 - loss: 0.7244
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=adagrad; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8562 - loss: 0.7011
134/134 - 0s - 982us/step
[CV] END model__activation=relu, model__units=64, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8510 - loss: 0.7158
134/134 - 0s - 960us/step
[CV] END model__activation=relu, model__units=64, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8213 - loss: 0.6654
134/134 - 0s - 964us/step
[CV] END model__activation=relu, model__units=128, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8247 - loss: 0.6459
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=128, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8615 - loss: 0.6482
134/134 - 0s - 971us/step
[CV] END model__activation=relu, model__units=128, optimizer=adam; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8425 - loss: 0.6385
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=128, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8534 - loss: 0.6353
134/134 - 0s - 990us/step
[CV] END model__activation=relu, model__units=128, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8421 - loss: 0.6451
134/134 - 0s - 975us/step
[CV] END model__activation=relu, model__units=128, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8582 - loss: 0.6305
134/134 - 0s - 967us/step
[CV] END model__activation=relu, model__units=128, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8871 - loss: 0.6285
134/134 - 0s - 941us/step
[CV] END model__activation=relu, model__units=128, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8553 - loss: 0.6513
134/134 - 0s - 945us/step
[CV] END model__activation=relu, model__units=128, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8245 - loss: 0.6388
134/134 - 0s - 979us/step
[CV] END model__activation=relu, model__units=128, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8412 - loss: 0.6436
134/134 - 0s - 960us/step
[CV] END model__activation=relu, model__units=128, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8183 - loss: 0.6763
134/134 - 0s - 967us/step
[CV] END model__activation=relu, model__units=128, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2306 - loss: 1.6097
134/134 - 0s - 949us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.3160 - loss: 1.5971
134/134 - 0s - 960us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2422 - loss: 1.5985
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2704 - loss: 1.6007
134/134 - 0s - 961us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2605 - loss: 1.6035
134/134 - 0s - 956us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2683 - loss: 1.5992
134/134 - 0s - 979us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2425 - loss: 1.6014
134/134 - 0s - 961us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2368 - loss: 1.6026
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2647 - loss: 1.5964
134/134 - 0s - 966us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2704 - loss: 1.5998
134/134 - 0s - 979us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2599 - loss: 1.5978
134/134 - 0s - 949us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2338 - loss: 1.6097
134/134 - 0s - 967us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2428 - loss: 1.6048
134/134 - 0s - 967us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2689 - loss: 1.5997
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.2525 - loss: 1.5950
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adam; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2333 - loss: 1.6021
134/134 - 0s - 960us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2365 - loss: 1.6041
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2720 - loss: 1.5987
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=rmsprop; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2646 - loss: 1.6008
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=sgd; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2475 - loss: 1.6024
134/134 - 0s - 993us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2441 - loss: 1.6082
134/134 - 0s - 941us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2297 - loss: 1.6066
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2402 - loss: 1.6078
134/134 - 0s - 967us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2368 - loss: 1.6138
134/134 - 0s - 945us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2398 - loss: 1.6052
134/134 - 0s - 994us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 3s - 13ms/step - accuracy: 0.2631 - loss: 1.6046
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adam; total time=   3.9s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2327 - loss: 1.6021
134/134 - 0s - 956us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2265 - loss: 1.6029
134/134 - 0s - 956us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2303 - loss: 1.6081
134/134 - 0s - 968us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2417 - loss: 1.6020
134/134 - 0s - 979us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2321 - loss: 1.6054
134/134 - 0s - 975us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2216 - loss: 1.6082
134/134 - 0s - 956us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2351 - loss: 1.6068
134/134 - 0s - 979us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2235 - loss: 1.6043
134/134 - 0s - 960us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2235 - loss: 1.6119
134/134 - 0s - 968us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2263 - loss: 1.6059
134/134 - 0s - 976us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2196 - loss: 1.6104
134/134 - 0s - 982us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adam; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2192 - loss: 1.6170
134/134 - 0s - 979us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2278 - loss: 1.6167
134/134 - 0s - 994us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2267 - loss: 1.6118
134/134 - 0s - 980us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2353 - loss: 1.6064
134/134 - 0s - 963us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2237 - loss: 1.6126
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2130 - loss: 1.6129
134/134 - 0s - 975us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2291 - loss: 1.6129
134/134 - 0s - 989us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=sgd; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2285 - loss: 1.6100
134/134 - 0s - 965us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=sgd; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2295 - loss: 1.6084
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2342 - loss: 1.6082
134/134 - 0s - 975us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2308 - loss: 1.6088
134/134 - 0s - 964us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
400/400 - 1s - 3ms/step - accuracy: 0.8854 - loss: 0.5120

A continuación se mostrarán los hiperparámetros seleccionados a través del GridSearch:

In [116]:
# Muestra los resultados
print("Mejor precisión obtenida: {:.2f}%".format(grid_result.best_score_ * 100))
print("Mejores hiperparámetros encontrados:", grid_result.best_params_)
Mejor precisión obtenida: 97.87%
Mejores hiperparámetros encontrados: {'model__activation': 'relu', 'model__units': 64, 'optimizer': 'adam'}
In [117]:
# Realiza la búsqueda de hiperparámetros utilizando GridSearchCV
grid_search_2 = GridSearchCV(estimator=keras_classifier_3000, param_grid=param_dist, cv=3, verbose=2)

grid_result_2 = grid_search_2.fit(X_train_p_3000, Y_train)
Fitting 3 folds for each of 32 candidates, totalling 96 fits
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7911 - loss: 0.8885
134/134 - 0s - 951us/step
[CV] END model__activation=relu, model__units=16, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.6550 - loss: 0.9532
134/134 - 0s - 990us/step
[CV] END model__activation=relu, model__units=16, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7990 - loss: 0.9420
134/134 - 0s - 934us/step
[CV] END model__activation=relu, model__units=16, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7600 - loss: 0.8807
134/134 - 0s - 994us/step
[CV] END model__activation=relu, model__units=16, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7930 - loss: 0.8949
134/134 - 0s - 915us/step
[CV] END model__activation=relu, model__units=16, optimizer=rmsprop; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8114 - loss: 0.9253
134/134 - 0s - 920us/step
[CV] END model__activation=relu, model__units=16, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7915 - loss: 0.8929
134/134 - 0s - 906us/step
[CV] END model__activation=relu, model__units=16, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7819 - loss: 0.8826
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7769 - loss: 0.8986
134/134 - 0s - 942us/step
[CV] END model__activation=relu, model__units=16, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8329 - loss: 0.8857
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8048 - loss: 0.9064
134/134 - 0s - 973us/step
[CV] END model__activation=relu, model__units=16, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8030 - loss: 0.9340
134/134 - 0s - 937us/step
[CV] END model__activation=relu, model__units=16, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8247 - loss: 0.8152
134/134 - 0s - 967us/step
[CV] END model__activation=relu, model__units=32, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8322 - loss: 0.7917
134/134 - 0s - 952us/step
[CV] END model__activation=relu, model__units=32, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8354 - loss: 0.8113
134/134 - 0s - 956us/step
[CV] END model__activation=relu, model__units=32, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8333 - loss: 0.8072
134/134 - 0s - 964us/step
[CV] END model__activation=relu, model__units=32, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8543 - loss: 0.8212
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8045 - loss: 0.8119
134/134 - 0s - 964us/step
[CV] END model__activation=relu, model__units=32, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8442 - loss: 0.7902
134/134 - 0s - 915us/step
[CV] END model__activation=relu, model__units=32, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8359 - loss: 0.8201
134/134 - 0s - 972us/step
[CV] END model__activation=relu, model__units=32, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8427 - loss: 0.7934
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8251 - loss: 0.7976
134/134 - 0s - 928us/step
[CV] END model__activation=relu, model__units=32, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8311 - loss: 0.8074
134/134 - 0s - 933us/step
[CV] END model__activation=relu, model__units=32, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8337 - loss: 0.7967
134/134 - 0s - 953us/step
[CV] END model__activation=relu, model__units=32, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8530 - loss: 0.6996
134/134 - 0s - 964us/step
[CV] END model__activation=relu, model__units=64, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8654 - loss: 0.7099
134/134 - 0s - 934us/step
[CV] END model__activation=relu, model__units=64, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8528 - loss: 0.7292
134/134 - 0s - 960us/step
[CV] END model__activation=relu, model__units=64, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8474 - loss: 0.7117
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8297 - loss: 0.7142
134/134 - 0s - 934us/step
[CV] END model__activation=relu, model__units=64, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8556 - loss: 0.7120
134/134 - 0s - 911us/step
[CV] END model__activation=relu, model__units=64, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8297 - loss: 0.7316
134/134 - 0s - 930us/step
[CV] END model__activation=relu, model__units=64, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8425 - loss: 0.7150
134/134 - 0s - 943us/step
[CV] END model__activation=relu, model__units=64, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8502 - loss: 0.7229
134/134 - 0s - 908us/step
[CV] END model__activation=relu, model__units=64, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8296 - loss: 0.7228
134/134 - 0s - 967us/step
[CV] END model__activation=relu, model__units=64, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8577 - loss: 0.7077
134/134 - 0s - 964us/step
[CV] END model__activation=relu, model__units=64, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8682 - loss: 0.7153
134/134 - 0s - 952us/step
[CV] END model__activation=relu, model__units=64, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8438 - loss: 0.6651
134/134 - 0s - 947us/step
[CV] END model__activation=relu, model__units=128, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8378 - loss: 0.6536
134/134 - 0s - 979us/step
[CV] END model__activation=relu, model__units=128, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8540 - loss: 0.6467
134/134 - 0s - 977us/step
[CV] END model__activation=relu, model__units=128, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8372 - loss: 0.6453
134/134 - 0s - 960us/step
[CV] END model__activation=relu, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8256 - loss: 0.6441
134/134 - 0s - 967us/step
[CV] END model__activation=relu, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8585 - loss: 0.6333
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8678 - loss: 0.6260
134/134 - 0s - 911us/step
[CV] END model__activation=relu, model__units=128, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8556 - loss: 0.6479
134/134 - 0s - 937us/step
[CV] END model__activation=relu, model__units=128, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8358 - loss: 0.6571
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=128, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8408 - loss: 0.6395
134/134 - 0s - 952us/step
[CV] END model__activation=relu, model__units=128, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8281 - loss: 0.6461
134/134 - 0s - 943us/step
[CV] END model__activation=relu, model__units=128, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8553 - loss: 0.6431
134/134 - 0s - 945us/step
[CV] END model__activation=relu, model__units=128, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2507 - loss: 1.6080
134/134 - 0s - 937us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2357 - loss: 1.6303
134/134 - 0s - 904us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2613 - loss: 1.6013
134/134 - 0s - 960us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2340 - loss: 1.6161
134/134 - 0s - 987us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2500 - loss: 1.5992
134/134 - 0s - 934us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2501 - loss: 1.5961
134/134 - 0s - 954us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2419 - loss: 1.6066
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2578 - loss: 1.6017
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2685 - loss: 1.6031
134/134 - 0s - 971us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2816 - loss: 1.6037
134/134 - 0s - 956us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2612 - loss: 1.5995
134/134 - 0s - 979us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2497 - loss: 1.5958
134/134 - 0s - 915us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2466 - loss: 1.5992
134/134 - 0s - 922us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2443 - loss: 1.5974
134/134 - 0s - 923us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2478 - loss: 1.5978
134/134 - 0s - 997us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2723 - loss: 1.5994
134/134 - 0s - 972us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 4s - 16ms/step - accuracy: 0.2528 - loss: 1.6034
134/134 - 0s - 963us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=rmsprop; total time=   4.5s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2366 - loss: 1.5988
134/134 - 0s - 930us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2464 - loss: 1.6040
134/134 - 0s - 986us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2498 - loss: 1.5977
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2377 - loss: 1.5972
134/134 - 0s - 971us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2548 - loss: 1.5986
134/134 - 0s - 934us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2501 - loss: 1.5963
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2383 - loss: 1.5982
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2196 - loss: 1.6023
134/134 - 0s - 916us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2250 - loss: 1.6027
134/134 - 0s - 961us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2467 - loss: 1.6003
134/134 - 0s - 979us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2224 - loss: 1.6061
134/134 - 0s - 952us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2440 - loss: 1.6027
134/134 - 0s - 997us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2447 - loss: 1.6003
134/134 - 0s - 945us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2366 - loss: 1.6009
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2365 - loss: 1.6064
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2357 - loss: 1.6032
134/134 - 0s - 975us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2248 - loss: 1.6159
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2305 - loss: 1.6074
134/134 - 0s - 978us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adagrad; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2293 - loss: 1.6065
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2314 - loss: 1.6158
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2327 - loss: 1.6076
134/134 - 0s - 989us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2227 - loss: 1.6092
134/134 - 0s - 942us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2271 - loss: 1.6084
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2310 - loss: 1.6065
134/134 - 0s - 967us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2297 - loss: 1.6052
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2226 - loss: 1.6093
134/134 - 0s - 960us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2188 - loss: 1.6124
134/134 - 0s - 926us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2484 - loss: 1.6040
134/134 - 0s - 923us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2340 - loss: 1.6127
134/134 - 0s - 905us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2310 - loss: 1.6105
134/134 - 0s - 919us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2297 - loss: 1.6100
134/134 - 0s - 956us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
400/400 - 1s - 2ms/step - accuracy: 0.8710 - loss: 0.5746
In [118]:
print("Mejor precisión obtenida: {:.2f}%".format(grid_result_2.best_score_ * 100))
print("Mejores hiperparámetros encontrados:", grid_result_2.best_params_)
Mejor precisión obtenida: 97.89%
Mejores hiperparámetros encontrados: {'model__activation': 'relu', 'model__units': 32, 'optimizer': 'adam'}
In [119]:
# Realiza la búsqueda de hiperparámetros utilizando GridSearchCV
grid_search_3 = GridSearchCV(estimator=keras_classifier_1700, param_grid=param_dist, cv=3, verbose=2)

grid_result_3 = grid_search_3.fit(X_train_p_1700, Y_train)
Fitting 3 folds for each of 32 candidates, totalling 96 fits
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8462 - loss: 0.8574
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=adam; total time=   1.5s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8018 - loss: 0.8717
134/134 - 0s - 964us/step
[CV] END model__activation=relu, model__units=16, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8063 - loss: 0.8687
134/134 - 0s - 949us/step
[CV] END model__activation=relu, model__units=16, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7986 - loss: 0.9384
134/134 - 0s - 926us/step
[CV] END model__activation=relu, model__units=16, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7718 - loss: 0.9476
134/134 - 0s - 986us/step
[CV] END model__activation=relu, model__units=16, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8131 - loss: 0.8810
134/134 - 0s - 986us/step
[CV] END model__activation=relu, model__units=16, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8164 - loss: 0.8880
134/134 - 0s - 925us/step
[CV] END model__activation=relu, model__units=16, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7362 - loss: 0.9230
134/134 - 0s - 945us/step
[CV] END model__activation=relu, model__units=16, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8046 - loss: 0.9038
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=16, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7544 - loss: 0.9571
134/134 - 0s - 914us/step
[CV] END model__activation=relu, model__units=16, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7905 - loss: 0.9515
134/134 - 0s - 934us/step
[CV] END model__activation=relu, model__units=16, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8170 - loss: 0.8948
134/134 - 0s - 915us/step
[CV] END model__activation=relu, model__units=16, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7934 - loss: 0.8330
134/134 - 0s - 953us/step
[CV] END model__activation=relu, model__units=32, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8266 - loss: 0.7867
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8268 - loss: 0.8048
134/134 - 0s - 949us/step
[CV] END model__activation=relu, model__units=32, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7952 - loss: 0.8125
134/134 - 0s - 950us/step
[CV] END model__activation=relu, model__units=32, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8159 - loss: 0.8189
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=32, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8166 - loss: 0.8258
134/134 - 0s - 941us/step
[CV] END model__activation=relu, model__units=32, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8020 - loss: 0.8059
134/134 - 0s - 924us/step
[CV] END model__activation=relu, model__units=32, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8236 - loss: 0.8109
134/134 - 0s - 915us/step
[CV] END model__activation=relu, model__units=32, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8459 - loss: 0.8065
134/134 - 0s - 915us/step
[CV] END model__activation=relu, model__units=32, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8464 - loss: 0.7953
134/134 - 0s - 930us/step
[CV] END model__activation=relu, model__units=32, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8234 - loss: 0.8132
134/134 - 0s - 967us/step
[CV] END model__activation=relu, model__units=32, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.7810 - loss: 0.8184
134/134 - 0s - 926us/step
[CV] END model__activation=relu, model__units=32, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8517 - loss: 0.7191
134/134 - 0s - 941us/step
[CV] END model__activation=relu, model__units=64, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8449 - loss: 0.6989
134/134 - 0s - 911us/step
[CV] END model__activation=relu, model__units=64, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8577 - loss: 0.7071
134/134 - 0s - 908us/step
[CV] END model__activation=relu, model__units=64, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8461 - loss: 0.7059
134/134 - 0s - 952us/step
[CV] END model__activation=relu, model__units=64, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8633 - loss: 0.6990
134/134 - 0s - 971us/step
[CV] END model__activation=relu, model__units=64, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8315 - loss: 0.7187
134/134 - 0s - 912us/step
[CV] END model__activation=relu, model__units=64, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8631 - loss: 0.7182
134/134 - 0s - 894us/step
[CV] END model__activation=relu, model__units=64, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8378 - loss: 0.7171
134/134 - 0s - 934us/step
[CV] END model__activation=relu, model__units=64, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8403 - loss: 0.7152
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=64, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8524 - loss: 0.6979
134/134 - 0s - 938us/step
[CV] END model__activation=relu, model__units=64, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8652 - loss: 0.6842
134/134 - 0s - 937us/step
[CV] END model__activation=relu, model__units=64, optimizer=adagrad; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8526 - loss: 0.7150
134/134 - 0s - 919us/step
[CV] END model__activation=relu, model__units=64, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8387 - loss: 0.6430
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=128, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.8646 - loss: 0.6371
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=128, optimizer=adam; total time=   1.2s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8579 - loss: 0.6482
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=128, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8547 - loss: 0.6383
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8509 - loss: 0.6341
134/134 - 0s - 1ms/step
[CV] END model__activation=relu, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8448 - loss: 0.6395
134/134 - 0s - 956us/step
[CV] END model__activation=relu, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8504 - loss: 0.6405
134/134 - 0s - 977us/step
[CV] END model__activation=relu, model__units=128, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8652 - loss: 0.6270
134/134 - 0s - 945us/step
[CV] END model__activation=relu, model__units=128, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8487 - loss: 0.6417
134/134 - 0s - 937us/step
[CV] END model__activation=relu, model__units=128, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8498 - loss: 0.6211
134/134 - 0s - 966us/step
[CV] END model__activation=relu, model__units=128, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8442 - loss: 0.6386
134/134 - 0s - 923us/step
[CV] END model__activation=relu, model__units=128, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.8596 - loss: 0.6418
134/134 - 0s - 924us/step
[CV] END model__activation=relu, model__units=128, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2661 - loss: 1.5957
134/134 - 0s - 907us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2486 - loss: 1.5973
134/134 - 0s - 990us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2730 - loss: 1.5967
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2365 - loss: 1.5987
134/134 - 0s - 936us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2526 - loss: 1.6061
134/134 - 0s - 935us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2615 - loss: 1.5974
134/134 - 0s - 991us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2550 - loss: 1.5915
134/134 - 0s - 934us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2732 - loss: 1.6057
134/134 - 0s - 927us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2885 - loss: 1.5996
134/134 - 0s - 927us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2533 - loss: 1.6051
134/134 - 0s - 908us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 4ms/step - accuracy: 0.2402 - loss: 1.5978
134/134 - 0s - 910us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adagrad; total time=   1.3s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2456 - loss: 1.6157
134/134 - 0s - 889us/step
[CV] END model__activation=sigmoid, model__units=16, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2361 - loss: 1.5954
134/134 - 0s - 919us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2501 - loss: 1.6312
134/134 - 0s - 905us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2546 - loss: 1.5988
134/134 - 0s - 958us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2539 - loss: 1.5974
134/134 - 0s - 960us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2376 - loss: 1.5991
134/134 - 0s - 956us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2703 - loss: 1.5998
134/134 - 0s - 906us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2511 - loss: 1.5937
134/134 - 0s - 889us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2265 - loss: 1.6046
134/134 - 0s - 885us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2463 - loss: 1.5992
134/134 - 0s - 890us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2545 - loss: 1.6008
134/134 - 0s - 908us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 5s - 17ms/step - accuracy: 0.2485 - loss: 1.5936
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adagrad; total time=   4.8s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2690 - loss: 1.5967
134/134 - 0s - 904us/step
[CV] END model__activation=sigmoid, model__units=32, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2301 - loss: 1.6019
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2344 - loss: 1.5991
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2398 - loss: 1.6010
134/134 - 0s - 987us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2507 - loss: 1.6045
134/134 - 0s - 964us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2395 - loss: 1.6013
134/134 - 0s - 945us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2447 - loss: 1.6001
134/134 - 0s - 980us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2391 - loss: 1.5975
134/134 - 0s - 984us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2443 - loss: 1.5994
134/134 - 0s - 967us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2171 - loss: 1.6022
134/134 - 0s - 950us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2417 - loss: 1.6035
134/134 - 0s - 971us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2395 - loss: 1.6067
134/134 - 0s - 975us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2214 - loss: 1.6075
134/134 - 0s - 931us/step
[CV] END model__activation=sigmoid, model__units=64, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2293 - loss: 1.6092
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adam; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2445 - loss: 1.6047
134/134 - 0s - 997us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2313 - loss: 1.6073
134/134 - 0s - 941us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adam; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2170 - loss: 1.6082
134/134 - 0s - 982us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2245 - loss: 1.6080
134/134 - 0s - 986us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=rmsprop; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2263 - loss: 1.6067
134/134 - 0s - 960us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=rmsprop; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2252 - loss: 1.6050
134/134 - 0s - 996us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2200 - loss: 1.6129
134/134 - 0s - 1ms/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=sgd; total time=   1.1s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2252 - loss: 1.6093
134/134 - 0s - 967us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=sgd; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2297 - loss: 1.6114
134/134 - 0s - 982us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2207 - loss: 1.6086
134/134 - 0s - 966us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
267/267 - 1s - 3ms/step - accuracy: 0.2259 - loss: 1.6057
134/134 - 0s - 934us/step
[CV] END model__activation=sigmoid, model__units=128, optimizer=adagrad; total time=   1.0s
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\scikeras\wrappers.py:925: UserWarning: ``build_fn`` will be renamed to ``model`` in a future release, at which point use of ``build_fn`` will raise an Error instead.
  X, y = self._initialize(X, y)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
400/400 - 1s - 2ms/step - accuracy: 0.8587 - loss: 0.6449
In [120]:
print("Mejor precisión obtenida: {:.2f}%".format(grid_result_3.best_score_ * 100))
print("Mejores hiperparámetros encontrados:", grid_result_3.best_params_)
Mejor precisión obtenida: 97.91%
Mejores hiperparámetros encontrados: {'model__activation': 'relu', 'model__units': 16, 'optimizer': 'adam'}

Ahora se revisarán nuevamente las métricas para el conjunto test.

In [125]:
# Get the best parameters
best_params_5100 = grid_result.best_params_

# Create a new model using the best parameters
best_model_5100 = create_model_5100(optimizer=best_params_5100['optimizer'], units=best_params_5100['model__units'], activation=best_params_5100['model__activation'])

# Train the best model on the entire training dataset
best_model_5100.fit(X_train_p_5100, Y_train, batch_size=20, epochs=50, verbose=1)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
Epoch 1/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 0.7477 - loss: 1.0147
Epoch 2/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 0.9981 - loss: 0.0100
Epoch 3/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 0.9992 - loss: 0.0049
Epoch 4/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 0.9998 - loss: 0.0028
Epoch 5/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 5.9603e-04
Epoch 6/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 3.3352e-04
Epoch 7/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 2.2002e-04
Epoch 8/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.5910e-04
Epoch 9/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.1885e-04
Epoch 10/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 8.5320e-05
Epoch 11/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 6.3026e-05
Epoch 12/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 4.5463e-05
Epoch 13/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 3.1682e-05
Epoch 14/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 1.9581e-05
Epoch 15/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.2378e-05
Epoch 16/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 8.1555e-06
Epoch 17/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 5.9651e-06
Epoch 18/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 4.4351e-06
Epoch 19/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 3.4079e-06
Epoch 20/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 2.5136e-06
Epoch 21/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 2.0880e-06
Epoch 22/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.6156e-06
Epoch 23/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.2751e-06
Epoch 24/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.0072e-06
Epoch 25/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 8.3258e-07
Epoch 26/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 6.4831e-07
Epoch 27/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 5.1146e-07
Epoch 28/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 4.1528e-07
Epoch 29/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 3.3615e-07
Epoch 30/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 2.8169e-07
Epoch 31/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 2.2631e-07
Epoch 32/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.7601e-07
Epoch 33/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.4074e-07
Epoch 34/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.1910e-07
Epoch 35/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 9.7406e-08
Epoch 36/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 8.0025e-08
Epoch 37/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 6.5909e-08
Epoch 38/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 3ms/step - accuracy: 1.0000 - loss: 5.0849e-08
Epoch 39/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 4.1691e-08
Epoch 40/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 3.6849e-08
Epoch 41/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 2.9797e-08
Epoch 42/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 2.3438e-08
Epoch 43/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.9923e-08
Epoch 44/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.7495e-08
Epoch 45/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.3067e-08
Epoch 46/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 1.0347e-08
Epoch 47/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 7.4338e-09
Epoch 48/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 5.6877e-09
Epoch 49/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 4.3448e-09
Epoch 50/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 1.0000 - loss: 3.3934e-09
Out[125]:
<keras.src.callbacks.history.History at 0x29a2dcf8890>
In [126]:
model_accuracy_t_5100 = best_model_5100.evaluate(X_test_p_5100, Y_test)
print("Model Accuracy:", model_accuracy_t_5100)
63/63 ━━━━━━━━━━━━━━━━━━━━ 0s 906us/step - accuracy: 0.9660 - loss: 0.2049
Model Accuracy: [0.15234297513961792, 0.9725000262260437]
In [127]:
Y_pred_hyp = best_model_5100.predict(X_test_p_5100)
# Encuentra el índice del valor máximo en cada fila
clases_predichas = np.argmax(Y_pred_hyp, axis=1)

print(clases_predichas)
print(classification_report(Y_test, clases_predichas))
plot_confusion_matrix(y_true=Y_test, y_pred=clases_predichas, classes=unique_labels, normalize=False,
                      title='Matriz de Confusión')
 1/63 ━━━━━━━━━━━━━━━━━━━━ 3s 52ms/step63/63 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step
[0 0 0 ... 4 4 4]
              precision    recall  f1-score   support

           0       0.96      0.95      0.95       400
           1       0.99      0.98      0.98       400
           2       0.98      0.99      0.99       400
           3       0.99      0.98      0.99       400
           4       0.95      0.96      0.95       400

    accuracy                           0.97      2000
   macro avg       0.97      0.97      0.97      2000
weighted avg       0.97      0.97      0.97      2000

Confusion matrix, without normalization
Out[127]:
<Axes: title={'center': 'Matriz de Confusión'}, xlabel='Predicted label', ylabel='True label'>

3000 Componentes Principales¶

In [128]:
# Get the best parameters
best_params_3000 = grid_result_2.best_params_

# Create a new model using the best parameters
best_model_3000 = create_model_3000(optimizer=best_params_3000['optimizer'], units=best_params_3000['model__units'], activation=best_params_3000['model__activation'])

# Train the best model on the entire training dataset
best_model_3000.fit(X_train_p_3000, Y_train, batch_size=20, epochs=50, verbose=1)
Epoch 1/50
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 0.6882 - loss: 1.0815
Epoch 2/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 0.9952 - loss: 0.0249
Epoch 3/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 0.9986 - loss: 0.0069
Epoch 4/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 0.9996 - loss: 0.0026
Epoch 5/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 0.9999 - loss: 0.0012
Epoch 6/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 5.9947e-04
Epoch 7/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 3.6952e-04
Epoch 8/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.5054e-04
Epoch 9/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.8275e-04
Epoch 10/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.4103e-04
Epoch 11/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.0637e-04
Epoch 12/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 7.7230e-05
Epoch 13/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 6.3224e-05
Epoch 14/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 4.5620e-05
Epoch 15/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 3.6953e-05
Epoch 16/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.9588e-05
Epoch 17/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.2522e-05
Epoch 18/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.7647e-05
Epoch 19/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 1.3656e-05
Epoch 20/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.1410e-05
Epoch 21/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 9.1350e-06
Epoch 22/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 7.2834e-06
Epoch 23/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 5.6306e-06
Epoch 24/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 4.5560e-06
Epoch 25/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 3.5398e-06
Epoch 26/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.8462e-06
Epoch 27/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 2.2551e-06
Epoch 28/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.7837e-06
Epoch 29/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.4562e-06
Epoch 30/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.1107e-06
Epoch 31/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 9.5766e-07
Epoch 32/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 7.4438e-07
Epoch 33/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 6.1263e-07
Epoch 34/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 4.8089e-07
Epoch 35/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 3.8908e-07
Epoch 36/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 3.0514e-07
Epoch 37/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.4797e-07
Epoch 38/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.9950e-07
Epoch 39/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.5905e-07
Epoch 40/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 1.2901e-07
Epoch 41/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.0855e-07
Epoch 42/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 9.0086e-08
Epoch 43/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 7.2976e-08
Epoch 44/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 5.8750e-08
Epoch 45/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 4.6693e-08
Epoch 46/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 3.7244e-08
Epoch 47/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 2.9592e-08
Epoch 48/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.5957e-08
Epoch 49/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.0900e-08
Epoch 50/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.6459e-08
Out[128]:
<keras.src.callbacks.history.History at 0x29a2e37b610>
In [129]:
model_accuracy_t_3000 = best_model_3000.evaluate(X_test_p_3000, Y_test)
print("Model Accuracy:", model_accuracy_t_3000)
63/63 ━━━━━━━━━━━━━━━━━━━━ 0s 943us/step - accuracy: 0.9761 - loss: 0.1348
Model Accuracy: [0.11227503418922424, 0.9804999828338623]
In [130]:
Y_pred_hyp = best_model_3000.predict(X_test_p_3000)
# Encuentra el índice del valor máximo en cada fila
clases_predichas = np.argmax(Y_pred_hyp, axis=1)

print(clases_predichas)
print(classification_report(Y_test, clases_predichas))
plot_confusion_matrix(y_true=Y_test, y_pred=clases_predichas, classes=unique_labels, normalize=False,
                      title='Matriz de Confusión')
63/63 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step
[0 0 0 ... 4 4 4]
              precision    recall  f1-score   support

           0       0.97      0.97      0.97       400
           1       1.00      0.98      0.99       400
           2       0.99      0.99      0.99       400
           3       0.99      0.99      0.99       400
           4       0.96      0.97      0.96       400

    accuracy                           0.98      2000
   macro avg       0.98      0.98      0.98      2000
weighted avg       0.98      0.98      0.98      2000

Confusion matrix, without normalization
Out[130]:
<Axes: title={'center': 'Matriz de Confusión'}, xlabel='Predicted label', ylabel='True label'>

1700 Componentes Principales¶

In [131]:
# Get the best parameters
best_params_1700 = grid_result.best_params_

# Create a new model using the best parameters
best_model_1700 = create_model_1700(optimizer=best_params_1700['optimizer'], units=best_params_1700['model__units'], activation=best_params_1700['model__activation'])

# Train the best model on the entire training dataset
best_model_1700.fit(X_train_p_1700, Y_train, batch_size=20, epochs=50, verbose=1)
c:\Users\user\BI-Sabroson\Machine-Learning-Labs\env\Lib\site-packages\keras\src\layers\core\dense.py:86: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
Epoch 1/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 0.7420 - loss: 1.0130
Epoch 2/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 977us/step - accuracy: 0.9949 - loss: 0.0243
Epoch 3/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 982us/step - accuracy: 0.9986 - loss: 0.0092
Epoch 4/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 0.9999 - loss: 0.0034
Epoch 5/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 985us/step - accuracy: 0.9998 - loss: 0.0021
Epoch 6/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 946us/step - accuracy: 0.9998 - loss: 0.0020
Epoch 7/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 966us/step - accuracy: 0.9965 - loss: 0.0114
Epoch 8/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 988us/step - accuracy: 0.9991 - loss: 0.0028
Epoch 9/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 992us/step - accuracy: 0.9989 - loss: 0.0050
Epoch 10/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 0.9997 - loss: 0.0016
Epoch 11/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 956us/step - accuracy: 0.9973 - loss: 0.0087
Epoch 12/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 944us/step - accuracy: 1.0000 - loss: 8.4803e-04
Epoch 13/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 965us/step - accuracy: 1.0000 - loss: 1.5106e-04
Epoch 14/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 960us/step - accuracy: 1.0000 - loss: 9.4808e-05
Epoch 15/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 961us/step - accuracy: 1.0000 - loss: 6.6610e-05
Epoch 16/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 940us/step - accuracy: 1.0000 - loss: 5.0945e-05
Epoch 17/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 4.3805e-05
Epoch 18/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 3.4928e-05
Epoch 19/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.6669e-05
Epoch 20/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.1703e-05
Epoch 21/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.7050e-05
Epoch 22/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.3957e-05
Epoch 23/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.0817e-05
Epoch 24/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 989us/step - accuracy: 1.0000 - loss: 8.9911e-06
Epoch 25/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 947us/step - accuracy: 1.0000 - loss: 7.2807e-06
Epoch 26/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 943us/step - accuracy: 1.0000 - loss: 5.9548e-06
Epoch 27/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 4.9761e-06
Epoch 28/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 1s 1ms/step - accuracy: 1.0000 - loss: 4.1877e-06
Epoch 29/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 3.4973e-06
Epoch 30/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.6766e-06
Epoch 31/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.1968e-06
Epoch 32/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.6740e-06
Epoch 33/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.3607e-06
Epoch 34/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 940us/step - accuracy: 1.0000 - loss: 1.1463e-06
Epoch 35/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 982us/step - accuracy: 1.0000 - loss: 9.4495e-07
Epoch 36/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 6.9512e-07
Epoch 37/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1000us/step - accuracy: 1.0000 - loss: 5.9057e-07
Epoch 38/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 4.5982e-07
Epoch 39/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 3.7386e-07
Epoch 40/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.8465e-07
Epoch 41/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 2.4249e-07
Epoch 42/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 939us/step - accuracy: 1.0000 - loss: 1.9407e-07
Epoch 43/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 953us/step - accuracy: 1.0000 - loss: 1.6290e-07
Epoch 44/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.3008e-07
Epoch 45/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 1.0160e-07
Epoch 46/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 8.6538e-08
Epoch 47/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 995us/step - accuracy: 1.0000 - loss: 6.8512e-08
Epoch 48/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 5.7634e-08
Epoch 49/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 4.9685e-08
Epoch 50/50
400/400 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - accuracy: 1.0000 - loss: 4.1679e-08
Out[131]:
<keras.src.callbacks.history.History at 0x29a2ebc6d10>
In [132]:
model_accuracy_t_1700 = best_model_1700.evaluate(X_test_p_1700, Y_test)
print("Model Accuracy:", model_accuracy_t_1700)
63/63 ━━━━━━━━━━━━━━━━━━━━ 0s 743us/step - accuracy: 0.9681 - loss: 0.2186
Model Accuracy: [0.1621309369802475, 0.9750000238418579]
In [133]:
Y_pred_hyp = best_model_1700.predict(X_test_p_1700)
# Encuentra el índice del valor máximo en cada fila
clases_predichas = np.argmax(Y_pred_hyp, axis=1)

print(clases_predichas)
print(classification_report(Y_test, clases_predichas))
plot_confusion_matrix(y_true=Y_test, y_pred=clases_predichas, classes=unique_labels, normalize=False,
                      title='Matriz de Confusión')
63/63 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step
[0 0 0 ... 4 4 4]
              precision    recall  f1-score   support

           0       0.96      0.95      0.96       400
           1       0.99      0.98      0.99       400
           2       0.99      0.99      0.99       400
           3       0.99      0.98      0.98       400
           4       0.94      0.97      0.96       400

    accuracy                           0.97      2000
   macro avg       0.98      0.97      0.98      2000
weighted avg       0.98      0.97      0.98      2000

Confusion matrix, without normalization
Out[133]:
<Axes: title={'center': 'Matriz de Confusión'}, xlabel='Predicted label', ylabel='True label'>

Luego de la búsqueda de hiperparámetros se encontró que el mejor número de componentes principales es de 3000, si bien para las tres búsquedas de hiperparámetros las métricas son muy buenas con 3000 se encontraron los mejores resultados.

4. Resultados¶

Tras la búsqueda de hiperparámetros, se observó una gran mejora en las métricas del modelo en comparación con el algoritmo base y las métricas de este interpretadas de las gráficas. La diferencia es significativa en términos absolutos, los resultados indican un avance importante, ya que el modelo ahora puede predecir todas las categorías con un accuracy bastante elevado.

Además, fue evidente que en el algoritmo base era demasiado complejo para la tarea de clasificación, es por esto que fue necesario no solo necesario reducir la cantidad de neuronas dentro de la capa oculta sino también reducir el número de componentes principales de un 95% a un 83%.

Por otro lado, la categoría de tecnología con la categoría de negocio parecen presentar una muy pequeña confusión de clasificaciones entre ellas, lo que permite al modelo clasificarla con mayor precisión. Este pequeño patrón puede significar que hay palabras que se repiten mucho en ambas categorías, como las marcas de las redes sociales, podría revisarse si es necesario realizar un filtrado de palabras mucho más severo y estricto para identificar.